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
/** | |
Supports creation of a String from pieces | |
*/ | |
public class StringBuilder { | |
private var stringValue: String | |
/** | |
Construct with initial String contents | |
:param: string Initial value; defaults to empty string |
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/env python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
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/env ruby | |
# | |
# Nagios plugin to monitor Redis sentinel | |
# | |
# Checks general connectivity to a Redis sentinel server and will go critical | |
# for any of the following conditions: | |
# * Inability to connect to the sentinel server | |
# * Sentinel reports it isn't monitoring any masters | |
# * Sentinel has entered TILT mode | |
# |
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/bash | |
### BEGIN INIT INFO | |
# Provides: redis sentinel | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts redis sentinel | |
# Description: Starts redis sentinel using start-stop-daemon | |
### 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
vagrant@ubuntu-12:/docker-pub/redis$ cat base/2.8.1/Dockerfile | |
FROM ubuntu:12.10 | |
MAINTAINER James McKernan [email protected] | |
RUN apt-get update | |
RUN apt-get install -y build-essential | |
ADD redis-2.8.1.tar.gz redis-2.8.1.tar.gz | |
RUN tar xvfz redis-2.8.1.tar.gz | |
RUN cd redis-2.8.1 && make | |
RUN cd redis-2.8.1 && make install |
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
// --- Compiling --- | |
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
$ tar xzvf redis-2.8.3.tar.gz | |
$ cd redis-2.8.3 | |
$ make | |
$ make install | |
// --- or using yum --- | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
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/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
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/xcrun swift -i -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk | |
// | |
// shell.swift | |
// | |
// Shell scripting in Swift, using a proper hashbang and a custom subshell operator. | |
// To run: `chmod +x shell.swift && ./shell.swift`. | |
// | |
// If you edit this in Xcode, ignore the error on the hashbang line. | |
// To play around with this in a playground, comment out the hashbang line. | |
// |
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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
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
package hornetq; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.atomic.AtomicReference; | |
import javax.jms.Connection; | |
import javax.jms.ConnectionFactory; | |
import javax.jms.JMSException; | |
import javax.jms.Topic; |