Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim tim-smart

View GitHub Profile
View jquery-center.js
;(function($) {
var $els = $('.js-vertical-center');
var fns = [];
$els.each(function(i, el) {
var $el = $(el);
fns.push(function() {
var elHeight = $el.height();
$el.css({
View make-clean.txt
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.3.2.1.000.000
TARGET_PRODUCT=full_mako
TARGET_BUILD_VARIANT=codefirex
TARGET_BUILD_TYPE=development
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_CFX_CLANG_VERSION=3.5
View mutt_pgp_mime_signature_0.1.0.patch
diff -rupN mutt-1.5.21/globals.h mutt-1.5.21.new/globals.h
--- mutt-1.5.21/globals.h 2009-08-26 07:08:52.000000000 +1200
+++ mutt-1.5.21.new/globals.h 2013-10-17 11:10:00.752568935 +1300
@@ -226,6 +226,8 @@ WHERE LIST *UserHeader INITVAL (0);
WHERE REGEXP PgpGoodSign;
WHERE char *PgpSignAs;
WHERE short PgpTimeout;
+WHERE char *PgpMimeSignatureFilename;
+WHERE char *PgpMimeSignatureDescription;
WHERE char *PgpEntryFormat;
View prompt_paradox_setup
# Load dependencies.
pmodload 'helper'
CURRENT_BG='NONE'
SEGMENT_SEPARATOR=''
function prompt_paradox_pwd {
local pwd="${PWD/#$HOME/~}"
if [[ "$pwd" == (#m)[/~] ]]; then
View after.js
var async = require('async');
function getUserFriends(userName, next) {
var s = {}
db.users.findOne({name:userName}, foundUser);
function foundUser(err, user) {
if (err != null) return next(err);
s.user = user
View write-stream-zero-end.js
var fs = require('fs')
var ws = new fs.WriteStream('test.out')
ws.write(new Buffer('test'))
ws.write(new Buffer([]))
ws.end(function () {
console.log('end')
})
View supermitter.js
var vm = require('vm')
var EventEmitter = require('events').EventEmitter
// ====
/**
* Supermitter - A compile-on-the-fly event emitter
*
* @constructor
*/
View foreach-nexttick.js
function forEachNextTick (obj, fn) {
var keys = Object.keys(obj)
function next () {
var key = keys.pop()
if (!key) return
fn(obj[key])
process.nextTick(next)
View digest.js
// The MIT License
//
// Copyright (c) 2012 Tim Smart
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and
// to permit persons to whom the Software is furnished to do so, subject to
View js-proto.js
function Parent () {
this.name = 'Roger'
}
Parent.prototype.yell = function yell () {
var parent = this
console.log('My name is ' + parent.name + '!!')
return parent
}
You can’t perform that action at this time.