This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/static/hammerlib.min.js"></script> | |
<script> | |
$(function(){ | |
hammerlib.bind("hammerlib", "opened", function(data) { | |
hammerlib.subscribe("stock_ticker"); | |
}); | |
hammerlib.bind("stock_ticker", "updated", function(data) { | |
$.each(["hammer", "gamma", "spacemonkey", "unicorn"], function(i, stock) { | |
var key = stock + "_ticker"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en := DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1) | |
Loop | |
{ | |
#IfWinActive | |
{ | |
w := DllCall("GetForegroundWindow") | |
pid := DllCall("GetWindowThreadProcessId", "UInt", w, "Ptr", 0) | |
l := DllCall("GetKeyboardLayout", "UInt", pid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var spawn = require('child_process').spawn; | |
var dtrace = spawn("dtrace", ["-s", "dtrace.d", "-C"]); | |
var known_ports = {}; | |
var pending_requests = {}; | |
dtrace.stdout.on("data", function(data){ | |
var lines = data.toString().split("\n"); | |
for (i in lines) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from amitu import d | |
# key advantages: | |
# 1. single file app | |
# 2. still fully compatible with existing django projects | |
# 3. auto matic url regex creation | |
# 4. all frequently used django functions/classes collected in d.* namespace | |
# Note: not yet sure if all of this is possible :-p | |
d( # callable modules are magic. some magic is good. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import luigi | |
class SimpleTask(luigi.Task): | |
name = luigi.Parameter() | |
def output(self): | |
return luigi.LocalTarget(self.name) | |
def run(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with table_stats as ( | |
select psut.relname, | |
psut.n_live_tup, | |
1.0 * psut.idx_scan / greatest(1, psut.seq_scan + psut.idx_scan) as index_use_ratio | |
from pg_stat_user_tables psut | |
order by psut.n_live_tup desc | |
), | |
table_io as ( | |
select psiut.relname, | |
sum(psiut.heap_blks_read) as table_page_read, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
stdin { | |
type => "foo" | |
} | |
} | |
filter { | |
if [type] == "foo" { | |
foo { | |
message => "Hello world!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java7_ppa: | |
cmd.run: | |
- name: add-apt-repository ppa:webupd8team/java --yes && apt-get update | |
- user: root | |
accept-license: | |
cmd.run: | |
- name: echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections | |
- unless: debconf-get-selections | grep -q shared/accepted-oracle-license-v1-1 | |
- user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from importd import d | |
from path import path | |
from datetime import datetime | |
from djangothis.app import dotslash, read_yaml, watchfile | |
from django.shortcuts import render | |
posts = None | |
labels = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find the list of backup files | |
# for each file see the position till where we have read the file from "stack" | |
# for each file see if there is more in it. | |
# if there is more, start reading and writing to keen | |
# find total size of all files | |
# go thru in ls -t order so we always traverse them in same order | |
from progressbar import ProgressBar | |
import keen, pdb, json, time |