Skip to content

Instantly share code, notes, and snippets.

@davidsan
davidsan / spring-el-read-file-content.xml
Created May 2, 2016 15:40
Spring EL to read the content of a file into a property
<property name="myProp" value="T(org.apache.commons.io.FileUtils).readFileToString(
T(org.springframework.util.ResourceUtils).getFile('${file-path}'),
'UTF-8')" />
#N canvas 557 113 514 595 10;
#X obj 136 204 +;
#X obj 161 81 trigger b b;
#X obj 183 42 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 129 270 print res;
#X floatatom 68 134 5 0 0 0 - - -;
#X floatatom 284 118 5 0 0 0 - - -;
#X obj 189 132 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
LE TARTUFFE CRÉATION
Molière
mise en scène Galin Stoev
DU 20 SEPTEMBRE AU 17 FÉVRIER
10
ANTIGONE
Jean Anouilh
mise en scène Marc Paquien
DU 26 SEPTEMBRE AU 2 DÉCEMBRE
package timezone;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class Main {
@davidsan
davidsan / eclipse.ini
Created October 26, 2014 22:18
For Eclipse Mars w/ some tweaks
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
@davidsan
davidsan / instagram.html
Last active October 5, 2017 07:59
Example of JSONP callback on Instagram Search API
<html>
<body>
<button id="btn" type="button">Search for jessicaalba on Instagram using JSONP</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.min.js"></script>
<script src="instagram.js"></script>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<passages gare="87393009">
<train><date mode="R">05/10/2014 13:54</date>
<num>165618</num>
<miss>POMI</miss>
<term>87391003</term>
</train>
<train><date mode="R">05/10/2014 13:55</date>
<num>165320</num>
<miss>DEFI</miss>
const N = 3
SENDER = SENDER[1],
SENDER[i:1..N] = (send[i] -> SENDER[i+1]),
SENDER[N+1] = STOP.
RECEIVER = RECEIVER[1],
RECEIVER[i:1..N] = (recv[i] -> RECEIVER[i+1]
| pass[i]->RECEIVER[i+1]),
RECEIVER[N+1]= STOP.
.file 1 "test_asm3.c"
.section .mdebug.abi32
.previous
.gnu_attribute 4, 1
.text
.align 2
.globl sum
.set nomips16
.ent sum
sum:
public class InterestingNumber {
// srm 611 div 2
public String isInteresting(String x) {
// For each D between 0 and 9, inclusive, X either does not contain the
// digit D at all, or it contains exactly two digits D, and there are
// precisely D other digits between them.
for (int i = 0; i <= 9; i++) {
String line = x;