I hereby claim:
- I am azhawkes on github.
- I am azhawkes (https://keybase.io/azhawkes) on keybase.
- I have a public key whose fingerprint is AF0C 077D AF5C 2F90 5BB9 70AE 8A64 011E 0695 1A98
To claim this, I am signing this object:
package com.andyhawkes.gists; | |
import org.eclipse.swt.graphics.Image; | |
import org.eclipse.swt.graphics.ImageData; | |
import org.eclipse.swt.graphics.Rectangle; | |
import org.eclipse.swt.widgets.Display; | |
/** | |
* Simple class that demonstrates how to slice up regions of a sprite image in SWT, while preserving | |
* alpha transparency. There are shorter ways to do this if you don't care about alpha transparency. |
public static void disableFullScreen(Shell shell) { | |
try { | |
Field windowField = Shell.class.getDeclaredField("window"); | |
windowField.setAccessible(true); | |
Object window = windowField.get(shell); | |
invoke(window.getClass(), window, "setCollectionBehavior", new Long[] { 0L }); | |
} catch (Exception e) { | |
log.error("couldn't disable full screen mode", e); | |
} |
#!/bin/bash | |
HOME="http://www.yourdomain.com/some/page" | |
DOMAINS="yourdomain.com" | |
DEPTH=2 | |
OUTPUT="./urls.csv" | |
wget -r --spider --delete-after --force-html -D "$DOMAINS" -l $DEPTH "$HOME" 2>&1 \ | |
| grep '^--' | awk '{ print $3 }' | grep -v '\. \(css\|js\|png\|gif\|jpg\)$' | sort | uniq > $OUTPUT |
" Vundle package manager | |
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" Vundle packages | |
Bundle 'gmarik/vundle' | |
Bundle 'maksimr/vim-jsbeautify' | |
Bundle 'einars/js-beautify' |
; .editorconfig | |
root = true | |
[**.js] | |
indent_style = space | |
indent_size = 4 | |
[**.css] | |
indent_style = space |
RewriteEngine on | |
# Automatically rewrite /something -> something.html | |
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d | |
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.html -f | |
RewriteRule /(.*)$ /$1.html [L] | |
# Strip off .html extensions from the request and redirect | |
RewriteCond %{REQUEST_URI} ^(.+)\.html$ | |
RewriteRule /(.*)\.html$ /$1 [R=301,L] |
class BootStrap { | |
def init = { servletContext -> | |
ArrayList.metaClass.commify = { | |
StringBuilder output = new StringBuilder() | |
for (int i = 0; i < delegate.size(); i++) { | |
if (i == 0) { | |
output.append(delegate[i]) | |
} else if (i == delegate.size() - 1) { | |
output.append(" and ${delegate[i]}") |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# Set these to the Docker hosts you want each container to run on | |
ZOOKEEPER_HOST=10.0.1.249 | |
NIMBUS_HOST=10.0.1.250 | |
SUPERVISOR_HOST=10.0.1.251 | |
# Run ZooKeeper | |
$ export DOCKER_HOST=tcp://$ZOOKEEPER_HOST:5000 | |
$ docker run -h zookeeper --name=zookeeper -d jplock/zookeeper |
var Express = require('express'); | |
var BodyParser = require('body-parser'); | |
var CredentialsService = require('infusionsoft-credentials'); | |
var app = Express(); | |
app.use(BodyParser.json()); | |
app.get('/activities', function(req, res) { | |
var accessToken = CredentialsService.resolveCredentials(req.params.credentialsId).accessToken; |