This file contains 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
var $ = require("jquery"); | |
var things = ["a", "b", "c", "d", "e", "f"]; | |
var mutex = 0; | |
var onSuccess = function( data){ | |
console.log(" Success: " + data + " [" + mutex + "]"); | |
var sentThing = things.shift(); | |
console.log(" Dequeue item: " + sentThing + " [" + mutex + "]") |
This file contains 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
import java.io.File; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import journal.io.api.Journal; |
This file contains 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
import java.util.*; | |
public class Partition { | |
public static void partition(int n, int l) { | |
partition(n, n, new ArrayList<Integer>(), l); | |
} | |
public static void partition(int n, int max, ArrayList<Integer> prefix, int l) { | |
if (n == 0 && prefix.size() == l) { | |
System.out.print(prefix); |
This file contains 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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: piboot | |
# Required-Start: $ntp $network $remote_fs $syslog | |
# Required-Stop: $ntp $network $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Emails out when the pi boots/shutsdown | |
### END INIT INFO |
This file contains 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
#!/usr/bin/expect | |
set timeout 20 | |
# I have the management server at tcp:localhost:1194 | |
spawn telnet localhost 1194 | |
expect ">INFO:OpenVPN Management Interface Version 1*" | |
send "status\n" | |
expect "END" |
This file contains 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
/** | |
* simple groovy server using spring boot | |
* | |
* spring run script.groovy | |
* | |
* uses: | |
* | |
* https://spring.io/blog/2013/08/06/spring-boot-simplifying-spring-for-everyone | |
* http://spring.io/guides/gs/uploading-files/ | |
* |
This file contains 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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<configuration> | |
<systemPropertyVariables> | |
<spring.profiles.active>test</spring.profiles.active> | |
</systemPropertyVariables> | |
</configuration> |
This file contains 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
{ | |
"plugins" : { | |
"metalsmith-static": { | |
"src": "public", | |
"dest": "." | |
} | |
} | |
} |
OlderNewer