Skip to content

Instantly share code, notes, and snippets.

J. Elliot Taylor jaytaylor

Block or report user

Report or block jaytaylor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jaytaylor
jaytaylor / PlayParameterReader.scala
Created Jul 11, 2011
Nice ParaNameReader for the Play! Framework v.1.2.2
View PlayParameterReader.scala
package PlayParameterReader
/**
* @author Jay Taylor <outtatime@gmail.com>
*
* @date 2011-05-23
*/
import scala.collection.JavaConversions._
@jaytaylor
jaytaylor / .tmux.conf
Created Aug 30, 2011
TMux Configuration
View .tmux.conf
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g default-terminal "screen-256color"
@jaytaylor
jaytaylor / .vimrc
Created Sep 20, 2011
Better Tab/Shift-Tab for block indentation
View .vimrc
" Paste this into your .vimrc to make tab/shift-tab work on blocks of text just like in a fancy GUI IDE
map <Tab> >gb
map <S-Tab> v<gv<ESC>0I<ESC>l
imap <S-Tab> <ESC>v<gv<ESC>0I
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
@jaytaylor
jaytaylor / output.txt
Created Oct 4, 2011
swagger build problems
View output.txt
Buildfile: /Users/jtaylor/klout/perks/swagger-core/build.xml
clean:
[echo] deleting build files
[echo] deleting libs handled by ivy
resolve:
[ivy:retrieve] :: Ivy 2.1.0-rc2 - 20090704004254 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: file = /Users/jtaylor/klout/perks/swagger-core/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: wordnik#swagger-core;working@secretcode
@jaytaylor
jaytaylor / StringExtras.scala
Created Oct 4, 2011
Pythonic Scala Strings
View StringExtras.scala
class StringExtras(string: String) { def % (args: Any*) = String.format(string, args.toArray.asInstanceOf[Array[Object]]: _*) }
implicit def stringExtras(string: String) = new StringExtras(string)
"%s, %s" % ("hello", "world")
@jaytaylor
jaytaylor / mysql-fast-loader.sh
Created Oct 20, 2011
Copies MySQL database to ramdisk then runs supplied shell script or command. The ramdisk version of the database is then copied back to the filesystem. Speeds up IO-intensive operations (e.g. loading heavily indexed tables.)
View mysql-fast-loader.sh
#!/usr/bin/env bash
##
# @author Jay Taylor <outtatime@gmail.com>
#
# @date 2011-10-20
#
# @description Copies MySQL database to ramdisk then runs supplied shell script
# or command. The ramdisk version of the database is then copied back to the
# filesystem. Speeds up IO-intensive operations (e.g. loading heavily indexed
@jaytaylor
jaytaylor / etc.init.openvpn.conf
Created Nov 3, 2011
Make OpenVPN run automatically as a service on Ubuntu. This includes an Upstart job and an expect script to automate OpenVPN private key password entry
View etc.init.openvpn.conf
# openvpn
#
description "OpenVPN - virtual private network daemon(s)"
author "Jay"
version "1.0.0"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
@jaytaylor
jaytaylor / CryptUtil.scala
Created Nov 10, 2011
Scala Port of Java Encryption Utility class originally found at http://bytebar.blogspot.com/2008/08/aes-encryption-in-java.html
View CryptUtil.scala
import javax.crypto.{Cipher, SecretKeyFactory, SecretKey}
import javax.crypto.spec.{PBEKeySpec, SecretKeySpec}
import java.lang.{Long => JLong}
import java.security.MessageDigest
import java.security.spec.KeySpec
import java.util.Arrays
/**
* @author Jay Taylor <jay@klout.com>
* @date 2011-11-09
View log4j-force-utc-timestamp.properties
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.A1.layout.ConversionPattern=[%d{ISO8601}{GMT}] %-4r [%t] %-5p %c %x - %m%n
@jaytaylor
jaytaylor / curl_request_async.inc.php
Created Feb 24, 2012
Asynchronous HTTP requests for PHP
View curl_request_async.inc.php
<?php
/**
* @author Jay Taylor [@jtaylor]
*
* @date 2012-02-23
*
* @description Originally found on SO:
* http://stackoverflow.com/questions/962915/how-do-i-make-an-asynchronous-get-request-in-php
*/
You can’t perform that action at this time.