Skip to content

Instantly share code, notes, and snippets.

// See http://ppanyukov.github.io/2017/02/01/golang-with-vsts-repos.html
package main
import (
"strings"
"fmt"
"os"
"log"
"net/http"
@rrafal
rrafal / sqlx_json.go
Created March 31, 2016 00:02
Use JSON field with golang sqlx driver
package main
import (
"encoding/json"
"errors"
"database/sql/driver"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"log"
@senki
senki / Combine Multiple Files.jsx
Created June 25, 2015 17:03
Mass combine a bunch of indd files into one
// DESCRIPTION: Mass combine a bunch of indd files into one.
// 6 July 2013
// edited by senki on 2015-06-21
// Added ability to move all pages not just first
// INSTRUCTIONS
// Put all the files you want to combine into one document in a folder, named in the order
// you want them to appear in the book (e.g. "001.indd", "002.indd", etc. or something) so
// they appear correctly when sorted by name in finder/explorer.
@return1
return1 / trim_enabler.txt
Last active May 26, 2024 11:01
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@xaviershay
xaviershay / LdapAuthenticator.java
Created July 24, 2012 03:27
LDAP Authentication for dropwizard
package com.squareup.alcatraz.auth;
import com.google.common.base.Optional;
import com.unboundid.ldap.sdk.Filter;
import com.unboundid.ldap.sdk.LDAPConnection;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.ResultCode;
import com.unboundid.ldap.sdk.SearchRequest;
import com.unboundid.ldap.sdk.SearchResult;
import com.unboundid.ldap.sdk.SearchResultEntry;