Skip to content

Instantly share code, notes, and snippets.

View tebriel's full-sized avatar

Chris M tebriel

View GitHub Profile
We couldn’t find that file to show.
<html><head><title>Hello, world!</title></head><body>Tacotacotaco!</body></html>
@tebriel
tebriel / README.md
Last active August 29, 2015 13:59 — forked from visualmotive/README.md

Sticky gravity is explained in depth here: http://tetrisconcept.net/wiki/Line_clear#Sticky

The playfield is divided into connected segments using flood fill. Any blocks that are adjacent horizontally or vertically are marked as one segment, that is, they are treated as having "stuck" together. Each segment falls independently until it meets the floor or another block. Additional line clears may result.

Sample input and expected output are included in this Gist.

> myarr = Array(20)
[ , , , , , , , , , , , , , , , , , , , ]
> for (var i=0; i<20; i+=3) {
... myarr[i] = 'taco';
... }
'taco'
> myarr
[ 'taco',
,
,

Keybase proof

I hereby claim:

  • I am tebriel on github.
  • I am cmoultrie (https://keybase.io/cmoultrie) on keybase.
  • I have a public key whose fingerprint is 6753 5CAE A733 8F24 F8BF 2C31 9F00 71E8 0918 D64E

To claim this, I am signing this object:

@tebriel
tebriel / downloadtransactions
Created August 11, 2014 16:20
Bookmarklet to download the last week's transactions on capital one's crappy, crappy site. Add this as a bookmark, then go to the transactions download page, click the bookmark, wait for the .qfx to get generated.
javascript:(function(){setDate = function(id, date) {$(id).val([date.getMonth()+1, date.getDate(), date.getFullYear()].join('/'))}; setDate('#txtFromDate_TextBox', new Date((new Date()).setDate((new Date()).getDate()-7))); setDate('#txtToDate_TextBox', new Date());$('#ctlStatementFilter_1').prop('checked', true);$('#btnDownload').click();})()
#!/usr/bin/env python3
# Find 5 friday (4) the 12th's
# python3 fridays_of.py 12 4 5
import datetime
import sys
def make_get_specified_date(start, day_of_month, day_of_week):
#!/usr/local/bin/python3
import urllib.request
import json
import sys
import os
URL = 'http://0.0.0.0:9200/_stats'
# COUNT_FILE = os.environ['HOME'] + '/tmp/es_count.tmp'
# COUNT_OUTPUT = os.environ['HOME'] + '/tmp/es_output.tmp'
COUNT_FILE = '/Users/cmoultrie/tmp/es_count.tmp'
input {
stdin {}
}
filter {
grok {
# Ex: I AM SOME DATA
match => ["message", "^%{DATA}$"]
}
if [data][info][score][value] {
POST /pindrop/_search HTTP/1.1
Content-Type: application/json
Host: logstash.local:9200
Connection: close
User-Agent: Paw/2.1.1 (Macintosh; OS X/10.10.2) GCDHTTPRequest
Content-Length: 209
{
size: 0,
"aggregations" : {