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
# | |
# WillPaginate::ViewHelpers | |
# | |
module WillPaginate | |
module ViewHelpers | |
# | |
# Renders a helpful message with numbers of displayed vs. total entries. | |
# | |
# + Only displayed if the collection.size is within the range of |
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
# This is an absolutely fucking infuriating monkey patch that allows rails | |
# to output valid html 4 (i.e leave some tag open) | |
# See http://rails.lighthouseapp.com/projects/8994/tickets/1565-patch-allow-disabling-of-self-closing-tags-generation-taghelpertag | |
# Dogmatic, clueless or just plain blind arrogance? | |
module ActionView | |
module Helpers | |
module TagHelper | |
include ERB::Util |
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 waveapi import simplejson | |
data = simplejson.loads(JSON) | |
"""TODO""" | |
def trace(obj): | |
yield obj | |
sprint = (lambda key, value: '%s => %s' % (key, value)) | |
typeof = (lambda obj, collection: type(obj) in collection) |
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 type="text/javascript"> | |
// *** EXPERIMENTAL *** | |
// | |
// This is an experimental method to be notified when Typekit's fonts have loaded. | |
// | |
// It will almost certainly change! Please do not use this on a live site. Please | |
// do let us know what you think by forking this gist, contacting us at | |
// support@typekit.com or on Get Satisfaction - http://getsatisfaction.com/typekit | |
// |
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
// | |
// jQuery Twitter | |
// | |
// user | |
var username = 'rayboyd'; | |
// callback | |
var callback = 'parseTwitterFeed'; |
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
Default Fonts in the iPhone SDK | |
-------------- | |
Family name: AppleGothic | |
Font name: AppleGothic | |
Family name: Hiragino Kaku Gothic ProN | |
Font name: HiraKakuProN-W6 | |
Font name: HiraKakuProN-W3 | |
Family name: Arial Unicode MS |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
int sendrecv(redis rdbs, const char *fmt, ...) | |
{ | |
va_list ap; | |
char *buf; | |
char *tmpbuf; | |
size_t bufsize = 0; | |
int arglen = 0; | |
for (;;) { |
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 agent = { | |
perpage: '15', | |
since_id: '0', | |
query: null, | |
page: null, | |
completed_in: null, | |
next_page: null, | |
refresh_url: null, | |
results: { | |
cache: [] |
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
int sendrecv(libre rdb, char *sendbuf) | |
{ | |
int s, r; | |
char recvbuf[LIBRE_MAX_BUFSIZE]; | |
/* send data */ | |
s = send(rdb->fd, sendbuf, strlen(sendbuf), 0); | |
if (s < 0) return LIBRE_FAILURE; | |
free(sendbuf); |
OlderNewer