Skip to content

Instantly share code, notes, and snippets.

@mccv
mccv / gist:1259343
Created October 3, 2011 15:14
OAuth with finagle streaming
import java.net._
import java.util.UUID
import com.twitter.conversions.time._
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.util._
import java.nio.charset.Charset
import org.jboss.netty.buffer.{ChannelBuffers, ChannelBuffer}
import org.jboss.netty.handler.codec.http._
import com.twitter.finagle.stream.Stream
@pamelafox
pamelafox / grunt.js
Created May 7, 2012 20:31
Grunt for a CSS/JS WebApp
/*global module:false*/
module.exports = function(grunt) {
var CSS_DIR = 'src/css/';
var JS_DIR = 'src/js/';
var BUILD_DIR = '../build/';
// Project configuration.
grunt.initConfig({
@breiter
breiter / org.macports.vpnc.plist
Last active October 6, 2015 18:23
vpnc launchd and start/stop control scripts
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.macports.vpnc</string>
<key>ProgramArguments</key>
<array>
@trastle
trastle / anyconnect-boot2docker.md
Last active November 27, 2015 23:25
Add routes to use Boot2Docker and AnyConnect at the same time on OSX.

Using boot2docker and AnyConnect at the same time

Boot2Docker works great, so does AnyConnect but running the two together causes traffic intended for Boot2Docker to head down the VPN link, this ruining everything.

Investigation

Tale a look at what network your Docker VirtualBox VM is on:

tastle@TASTLE ~ $ env | grep DOCKER_HOST
DOCKER_HOST=tcp://192.168.59.103:2376
@dpratt
dpratt / spray-stream-enumerator
Created July 24, 2014 16:52
A Spray chunking marshaller for Play Enumerators
package com.vast.utils
import akka.actor._
import akka.io.Tcp
import play.api.libs.iteratee._
import scala.concurrent.ExecutionContext
import spray.http._
import spray.httpx.marshalling.{MarshallingContext, Marshaller}
import akka.util.{ByteString, Timeout}
import scala.util.control.NonFatal
@dimaulupov
dimaulupov / install-cloud9.sh
Created July 10, 2012 05:29
Ruby 1.9.3 installer for Cloud9 workspaces
#!/bin/bash
# This script downloads and installs Ruby 1.9.3-p194 into Cloud9 workspace.
# It makes possible to use Ruby 1.9 for running apps there instead of default Ruby 1.8.7
# Create this file in a root of your workspace.
# Run in command line: chmod +x install-cloud9.sh
# And: ./install-cloud9.sh
# It will take some time to download and compile libyaml and ruby.
# Adjust ruby version paths according to your needs.
@chemzqm
chemzqm / webpack.js
Last active January 2, 2018 12:05
webpack plugin for tern
// drop this into <tern folder>/plugin
// run `npm i enhanced-resolve` in you tern folder
// add config "plugins": { "webpack": {}} to your .tern_project
// done
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
return mod(require("../lib/infer"), require("../lib/tern"), require("./commonjs"), require)
if (typeof define == "function" && define.amd) // AMD
return define(["../lib/infer", "../lib/tern", "./commonjs"], mod)
mod(tern, tern)
@krams915
krams915 / SpringDataConfig.java
Created December 2, 2012 01:47
SpringDataConfig JavaConfig
package org.krams.config;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
@firejune
firejune / README.md
Created September 9, 2011 18:29
Secure with HTTP Authentication for Cloud9 IDE

Add Secure with HTTP Authentication for Cloud9 IDE.

git clone https://github.com/ajaxorg/cloud9.git
git submodule update --init --recursive
git apply cloud9.patch
git clone git://github.com/semu/connect-basic-auth.git support/connect-basic-auth
node bin/cloud9.js -c config.js 

Open the url http://127.0.0.1:3000/ when prompt the authorization,username is "username" and password is "password".