Skip to content

Instantly share code, notes, and snippets.

View figital's full-sized avatar
💭
github status lol

figital figital

💭
github status lol
View GitHub Profile
@figital
figital / example.sql
Created April 18, 2017 20:06 — forked from wolever/example.sql
A simple Postgres aggregate function for calculating a trimmed mean, excluding values outside N standard deviations from the mean: `tmean(v, standard_deviations)` (for example: `tmean(rating, 1.75)`).
DROP TABLE IF EXISTS foo;
CREATE TEMPORARY TABLE foo (x FLOAT);
INSERT INTO foo VALUES (1);
INSERT INTO foo VALUES (2);
INSERT INTO foo VALUES (3);
INSERT INTO foo VALUES (4);
INSERT INTO foo VALUES (100);
SELECT avg(x), tmean(x, 2.0), tmean(x, 1.5) FROM foo;
#!/bin/sh
spawn telnet 1.3.3.184 4998
expect "Escape character is '^]'."
send "setstate,1:2,1\r"
expect "setstate,1:2,1"
@figital
figital / 0_reuse_code.js
Created December 3, 2013 16:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@figital
figital / chromiumer-devtools.sh
Created July 25, 2011 15:43 — forked from cowboy/chromiumer-devtools.sh
chromiumer.sh bash script that will download the latest Chromium chrome-mac.zip and devtools_frontend.zip, extract them into cwd, and link them together using --debug-devtools-frontend.
#!/bin/bash
# I use this (optional) file to make the font larger for presentations - Cowboy
echo -n "Modifying fonts..."
find "$1" \( -name devTools.css \) \
-exec sh -c 'cat >> $1 <<EOF
/* Added on `date` */
body.platform-mac.platform-mac-snowleopard .monospace,