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
@jeffskinnerbox
jeffskinnerbox / XBeeTerm.py
Last active July 16, 2019 15:52
This command interpreters establishes communications with XBee radios so that AT Commands can be sent to the XBee. The interpreters output is color coded to help distinguish user input, from XBee radio output, and from interpreters output.
#!/usr/bin/env python
"""XBeeTerm.py is a XBee serial command shell for interacting with XBee radios
This command interpretors establishes communications with XBee radios so that AT Commands can be sent to the XBee.
The interpretors output is color coded to help distinguish user input, from XBee radio output, and from
interpretors output. This command-line interpretor uses Python module Cmd, and therefore, inherit bash-like history-list
editing (e.g. Control-P or up-arrow scrolls back to the last command, Control-N or down-arrow forward to the next one,
Control-F or right-arrow moves the cursor to the right non-destructively, Control-B or left-arrow moves the cursor
to the left non-destructively, etc.).
@wolever
wolever / example.sql
Created January 4, 2013 23:00
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;
@jjdelc
jjdelc / crayola.json
Created February 20, 2012 06:32
Crayola colors in JSON format
[
{
"hex": "#EFDECD",
"name": "Almond",
"rgb": "(239, 222, 205)"
},
{
"hex": "#CD9575",
"name": "Antique Brass",
"rgb": "(205, 149, 117)"
@Swizec
Swizec / paragraph_counter.js
Created September 16, 2011 14:52
Simple script to see how far users scroll on a website
(function ($) {
$.waypoints.settings.scrollThrottle = 30;
try {
mpmetrics = new MixpanelLib("<api_key>");
} catch(err) {
var null_fn = function () {};
mpmetrics = {
track: null_fn,
track_funnel: null_fn,
@figital
figital / fstring
Created February 9, 2011 21:12
fstring
#! /bin/bash
# description: search a directory for a string, output filenames and context
# usage: fstring /tmp/whatever mysearch
# example: fstring ./ hello (search current directory for string "hello"
# better example:
# sfitchet@crunchbang:/tmp/myapp$ fstring ./ array_slice
@rwaldron
rwaldron / style-guide.js
Created January 24, 2011 18:20
Writing Idiomatic JavaScript
1. Two space soft indents (fake tabs) OR tabs... BUT NEVER BOTH - DO NOT MIX
2. Whitespace, Parens, Braces, Linebreaks
if/else/for/while/try always have spaces, braces and multiple lines.
--------------------------------------------------------------------