This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| TABLE_SCHEMA, | |
| TABLE_NAME, | |
| COLUMN_NAME, | |
| DATA_TYPE | |
| FROM | |
| INFORMATION_SCHEMA.COLUMNS | |
| WHERE | |
| DATA_TYPE = 'datetime' AND TABLE_SCHEMA = 'atomik' | |
| ORDER BY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Patient fhirPatient = ... | |
| for (HumanName name : fhirPatient.getName()) | |
| { | |
| // family names with extensions | |
| StringType familyElement = name.getFamilyElement(); | |
| if (familyElement != null) { | |
| System.out.println("Family: " + familyElement.getValue()); | |
| for (Extension ext : familyElement.getExtension()) { | |
| System.out.println(" Family Extension: " + ext.getUrl() + " = " + ext.getValue()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // define the url | |
| def url = "http://news.google.com/news?ned=us&topic=h&output=rss" | |
| def rss = new XmlSlurper().parse(url) | |
| println rss.channel.title | |
| rss.channel.item.each { | |
| println "- ${it.title}" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Convierte un documento XML a un string XML | |
| // http://stackoverflow.com/questions/6507293/convert-xml-to-string-with-jquery | |
| function xmlToString(xmlData) { | |
| var xmlString; | |
| //IE | |
| if (window.ActiveXObject) { | |
| xmlString = xmlData.xml; | |
| } | |
| // code for Mozilla, Firefox, Opera, etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def subjectUid = '...' | |
| if (!(subjectUid ==~ /([a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})/)) | |
| { | |
| return 'error' | |
| } | |
| return 'ok' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // CSV is simple means it doesn't include commas so there is no value separator like " inside the CSV | |
| // Though we take into account there could be spaces after the commas and before the values, and those are removed | |
| // Though the spaces after the values are not removed so "a , b" would be parsed as ["a ", "b"] | |
| def b = "a, b b, c c c" | |
| b = b.replaceAll(",( )*", ",") | |
| println b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def a = ["a", "b", "c"] | |
| "value LIKE "+ a.collect {"'%"+ it + "%'"}.join(" OR value LIKE ") | |
| // value LIKE '%a%' OR value LIKE '%b%' OR value LIKE '%c%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function snakeToCamelCase(string $input): string | |
| { | |
| return ucfirst(str_replace('_', '', ucwords(strtolower($input), '_'))); | |
| } | |
| function getClassNameRecursive($string, $start, $end) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Formats to comply with https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified | |
| java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); | |
| format.setTimeZone(TimeZone.getTimeZone("GMT")); | |
| println format.format(new Date()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function $co(key, value) { if (arguments.length == 1) { return connectorMap.get(key); } else { return connectorMap.put(key, value); } } | |
| function $c(key, value) { if (arguments.length == 1) { return channelMap.get(key); } else { return channelMap.put(key, value); } } | |
| function $s(key, value) { if (arguments.length == 1) { return sourceMap.get(key); } else { return sourceMap.put(key, value); } } | |
| function $gc(key, value) { if (arguments.length == 1) { return globalChannelMap.get(key); } else { return globalChannelMap.put(key, value); } } | |
| function $g(key, value) { if (arguments.length == 1) { return globalMap.get(key); } else { return globalMap.put(key, value); } } | |
| function $cfg(key, value) { if (arguments.length == 1) { return configurationMap.get(key); } else { return configurationMap.put(key, value); } } | |
| function $r(key, value) { if (arguments.length == 1) { return responseMap.get(key); } else { return responseMap.put(key, value); } } | |
| function $(string) { | |
| try { if(responseMap.containsKey(string)) { return |
NewerOlder