Skip to content

Instantly share code, notes, and snippets.

View jrabbit's full-sized avatar
🍡

Jack Laxson jrabbit

🍡
View GitHub Profile
@richardtorres314
richardtorres314 / flexbox.scss
Last active May 4, 2024 06:31
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@jrabbit
jrabbit / directory.py
Created April 6, 2012 14:52
Make an app folder/ get app folder
def directory(app_name):
"""Construct app_dir from os name"""
home = os.path.expanduser('~')
if platform.system() == 'Linux':
app_dir = os.path.join(home, '.' + app_name)
elif platform.system() == 'Darwin':
app_dir = os.path.join(home, 'Library', 'Application Support',
app_name)
elif platform.system() == 'Windows':
app_dir = os.path.join(os.environ['appdata'], app_name)
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@buzztaiki
buzztaiki / gjs-io-sample.js
Created December 16, 2011 20:18
gjs-io-sample.js
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
let [res, out, err, status] = GLib.spawn_command_line_sync('ls -la');
print(out);
let [res, out] = GLib.spawn_command_line_sync('ls -la');
print(out);
let [res, out] = GLib.spawn_sync(null, ['/bin/ls', '-la'], null, 0, null);
<!DOCTYPE html>
<html>
<style type='text/css'>
object{
display: block;
margin-left: auto;
margin-right: auto;
}
html{
background: #0E0E0E;
@sanguis
sanguis / .gitconfig
Last active June 2, 2017 14:41
my .gitconfig file minus my name and email
[color]
ui = on
[core]
whitespace= fix,-indent-with-non-tab,-indent-with-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[alias]
df = !git diff --no-prefix && git diff --staged --no-prefix
clear = reset --hard
st = status
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

Timeline. Include what you plan to have accomplished by the end of:

Community bonding period (May 23) -

  • Buildbot stuff done (should take a week[end])

  • Hpkg-Build is in a good place with packages. (No work may need to be done, I haven't stayed on top of how well it works with the package manager implementation.)

Quarter-term (June 13) -

@jrabbit
jrabbit / gist:789415
Created January 21, 2011 08:22
Clean the $PATH then return it to normal. Make homebrew more harmonious with Fink et al.
diff --git a/bin/brew b/bin/brew
index 4ec64f0..79a1fb4 100755
--- a/bin/brew
+++ b/bin/brew
@@ -11,7 +11,11 @@ require 'pathname'
HOMEBREW_LIBRARY_PATH = (Pathname.new(__FILE__).realpath.dirname.parent+"Library/Homebrew").to_s
$:.unshift(HOMEBREW_LIBRARY_PATH)
require 'global'
-
+def path_clean
@jrabbit
jrabbit / Round Clock.py
Created October 5, 2010 04:31
Kilosecond Clocks.
import Image, ImageDraw
import time
im = Image.open("kilosec_round.PNG")
draw = ImageDraw.Draw(im)
def kiloseconds():
tm = time.localtime()
return (tm.tm_hour*3600+tm.tm_min*60+tm.tm_sec)/1000.0
#http://github.com/api/v2/json/blob/show/bavardage/kiloseconds/03fac33ed6be1f0a004319cf7b8449d6d5fb10f3
@jrabbit
jrabbit / gist:559913
Created August 31, 2010 22:47
download youtube comments
import gdata.youtube
import gdata.youtube.service
from BeautifulSoup import BeautifulSoup
yt_service = gdata.youtube.service.YouTubeService()
# The YouTube API does not currently support HTTPS/SSL access.
yt_service.ssl = False
yt_service.developer_key = "AI39si6sDAt4km6PVp3cw5U4MIoUAVKi-R0hVSALYdjz7EIH_Leik-7s_fxeHQZKpx6fXilSx5PvYqhk16Gg1APQFJDRncXh6g"
yt_service.client_id = "yt comments"
def get_comments():