Skip to content

Instantly share code, notes, and snippets.

@iangreenleaf
iangreenleaf / rvmrc
Created June 21, 2011 06:27
rvm ebuild for Gentoo - not completely kosher
umask g+w
export rvm_path="/usr/local/rvm"
@Raynos
Raynos / critique.md
Created December 1, 2011 14:15
jQuery library critique

jQuery

Related: [Why you don't need jQuery as an abstraction][2]

$ itself is a god object. Everything goes on it. The standard plugin / extension architecture that is recommended is to just bolt more methods on $ itself!

Surely this is bad. An example would be how we have both $.load which is overloaded to do completely different things. If they were on two separate sensibly named objects $Container.load and $EventTarget.load. Personally I would deprecate the latter in favour of .on('load'

The animation should be it's own little modular thing, not bolted onto $. Ajax should be it's own little modular thing, not bolted onto $

server {
listen 443;
server_name git.eatabrick.org;
error_log /var/log/nginx/git.error.log;
access_log /var/log/nginx/git.access.log;
# ssl because cox sucks
ssl on;
ssl_certificate /etc/nginx/ssl/git.eatabrick.org;
@tsileo
tsileo / glaciervault.py
Created October 17, 2012 20:12
Wrapper for uploading/download archive to/from Amazon Glacier Vault
# encoding: utf-8
import os
import shelve
import boto.glacier
import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
ACCESS_KEY_ID = "XXXXXXXXXXXXX"
SECRET_ACCESS_KEY = "XXXXXXXXXXX"
SHELVE_FILE = os.path.expanduser("~/.glaciervault.db")
@xdissent
xdissent / errors.coffee
Created May 27, 2014 16:03
Extendable native Error subclasses in Coffeescript
ok = (ok) -> console.log if ok then 'ok' else 'FAIL'
FnError = (message) ->
@name = 'FnError'
@message = message
@stack = (new Error).stack
FnError:: = new Error
@mmueller
mmueller / bitly.py
Created April 28, 2011 22:52
Command-line bit.ly URL generator (Python)
#!/usr/bin/env python
#
# Copyright 2009 Empeeric LTD. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@razor-x
razor-x / scss.xml
Created May 6, 2011 08:16
SCSS syntax highlighting for Kate. Based on Kate CSS syntax file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
Kate SCSS syntax highlighting definition
Modified the Kate CSS syntax highlighting definition to support SCSS.
This file should be merged with any updates to the normal Kate CCS definition (see note on version numbering in changelog for 1.2.03.0).
The latest version of this file can be found at https://gist.github.com/958598
@Raynos
Raynos / jQuery.md
Created January 14, 2012 22:44
Why you don't need jQuery

Why the jQuery Abstraction isn't needed.

(One needs some form of browser normalization so that modern features works, no-one is doubting that).

Related: [jQuery library critique][2]

Abstractions that aren't needed

Selectors

@SciresM
SciresM / switch_romfs.py
Created July 19, 2017 01:10
Switch RomFS (IStorage) -> Files
from struct import unpack as up
import sys, os
dirs, files = None, None
def read_at(fp, off, len):
fp.seek(off)
return fp.read(len)
def read_u8(fp, off):
@sfan5
sfan5 / image2xterm.py
Last active July 13, 2020 18:24
Converts images into color sequences (xterm-256color)
#!/usr/bin/env python3
import sys
import getopt
from PIL import Image
xterm256colors = [ # http://pln.jonas.me/xterm-colors
(0, (0x00, 0x00, 0x00)), # SYSTEM
(1, (0x80, 0x00, 0x00)), # SYSTEM
(2, (0x00, 0x80, 0x00)), # SYSTEM
(3, (0x80, 0x80, 0x00)), # SYSTEM