Skip to content

Instantly share code, notes, and snippets.

View dtjm's full-sized avatar

Sam Nguyen dtjm

  • Twilio SendGrid
  • Pacific Northwest
View GitHub Profile
@dtjm
dtjm / index.html
Last active December 26, 2015 13:48
SendGrid cover letter
<html>
<head>
<meta charset='utf-8'>
<title>EHLO SendGrid</title>
<style type="text/css">
body {
background-color: #eee;
color: #222;
font-family: "Courier", monospace;
font-size: 16px;
@dtjm
dtjm / cramfs-osx.diff
Created September 9, 2011 20:52
cramfs patch for OS X
--- cramfs-1.1/cramfsck.c 2011-09-09 13:39:01.000000000 -0700
+++ cramfs-dtjm/cramfsck.c 2011-09-09 13:39:02.000000000 -0700
@@ -47,14 +47,17 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include <sys/sysmacros.h>
#include <utime.h>
#include <sys/ioctl.h>
#define _LINUX_STRING_H_
@dtjm
dtjm / datatables.set_filter_debounce.js
Created June 23, 2011 22:14
Search filter debounce for Allan Jardine's DataTables plugin for jQuery. Requires Underscore.js
jQuery.fn.dataTableExt.oApi.fnSetFilterDebounce = function ( oSettings, iDelay ) {
/*
* Type: Plugin for DataTables (www.datatables.net) JQuery plugin.
* Name: dataTableExt.oApi.fnSetFilterDebounce
* Version: 0.01
* Description: Enables filtration debouncing which prevents filter from
* happening until keypresses have stopped for [iDelay] milliseconds.
* Uses code from Zygimantas' fnSetFilteringDelay
* Inputs: object:oSettings - dataTables settings object
package mypackage
import (
"encoding/base64"
"crypto/hmac"
"http"
"testing"
"time"
)
package main
import (
"fmt"
"github.com/Philio/GoMySQL"
"os"
)
type Thing struct {
Text1, Text2 string
require 'sinatra'
require 'net/http/post/multipart'
get '/' do
file = Tempfile.new("temp.txt")
file << "test contents"
file.flush
request = Net::HTTP::Post::Multipart.new(
"http://localhost:4567/upload",
@dtjm
dtjm / subversion-prompt.sh
Created August 19, 2010 18:13
Subversion PS1 prompt functions for bash
#
# If you want to see svn modifications:
# export SVN_SHOWDIRTYSTATE=1
#
# Put this in your PS1 like this:
# PS1='\u@\h:\W\[\033[01;33m\]$(__git_svn_ps1)\[\033[00m\]$ '
# Git/Subversion prompt function
__git_svn_ps1() {
@dtjm
dtjm / haml_converter.rb
Created August 17, 2010 06:07 — forked from radamant/haml_converter.rb
Haml and Sass plugin for Jekyll 0.6.2
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
@dtjm
dtjm / config
Created August 13, 2010 17:34
Wrapper to use OS X FileMerge when calling `svn diff`
### ~/.subversion/config
### Add this line to the [helpers] section
diff-cmd = ~/bin/svn-diffwrap.sh
@dtjm
dtjm / .bash_aliases
Created August 13, 2010 17:10
My bash configs.
alias ll='ls -l'
alias lla='ls -la'
alias llh='ls -lh'