Skip to content

Instantly share code, notes, and snippets.

@tj
tj / asya
Created January 24, 2018 18:39
View asya
...e$e.$...e$ ...e$e.$...e
!$6lkasd!$6lkasd!$6l !$6lkasd!$6lkasd!
;,a1wert;,a1wert;,a1wert ;,a1wert;,a1wert;,a1we
.asxzcvb.asxzcvb.asxzcvb.as .asxzcvb.asxzcvb.asxzcvb.
1qaswedfqas1wedfqas1wedfqas1wedfqas1wedfqas1edfqas1ewdfqa
:lkjhgfdlkj:hgfdlkj:hgfdlkj:hgfdlkj:hgfdlkj:gfdhlkj:gfdhlk
3edcvfr4edc3vfr4edc3vfr4edc3vfr4edc3vfr4edc3fr4vedc3fr4ved
1234ewqa2341ewqa2341ewqa2341ewqa2341ewqa2341wqa2341weqa234
o[piuytr[piouytr[piouytr[piouytr[piouytr[pioytru[pioytru[p
z/xcvbnm/xczvbnm/xczvbnm/xczvbnm/xczvbnm/xczbnmv/xczbnmv/x
@tj
tj / deploy.conf
Created May 24, 2011 22:43
start of deployment script
View deploy.conf
key /path/to/whatever.pem
user deployer-of-doom
addr n.n.n.n
repo git@github.com:visionmedia/express.git
path /path/to/www/whatever
branch origin/master
command /path/to/www/whatever/restart
View person.ajs
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })
@tj
tj / haml.js
Created December 18, 2009 19:00
View haml.js
/* ex:ts=2:et: */
/*jslint bitwise: true, browser: true, eqeqeq: true, evil: true, immed: true, newcap: true,
nomen: true, plusplus: true, regexp: true, undef: true, white: true, indent: 2 */
/*globals */
var Haml = {};
// Bind to the exports object if it exists. (CommonJS and NodeJS)
if (exports) {
Haml = exports;
@tj
tj / app.js
Last active October 4, 2021 19:38
View app.js
const http = require('http')
const rpc = require('./rpc')
/**
* Pets service.
*/
class Pets {
constructor(db = []) {
@tj
tj / app.js
Created August 31, 2012 05:33
users online with redis
View app.js
var express = require('express');
var redis = require('redis');
var db = redis.createClient();
var app = express();
// track users online (replace UA string with user id)
app.use(function(req, res, next){
var ua = req.headers['user-agent'];
@tj
tj / git aliases.sh
Last active July 26, 2021 05:56
Some helpful git aliases
View git aliases.sh
alias gd="git diff"
alias gc="git clone"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gpt="git push --tags"
alias gp="git push"
alias gpr="git pull-request"
alias grh="git reset --hard"
View preact.go
// Package preact provides bindings to the preact library.
package preact
import "github.com/gopherjs/gopherjs/js"
var preact = js.Global.Get("preact")
// Attrs of an element.
type Attrs map[string]interface{}
View search.css
input[type="search"]::-webkit-search-cancel-button {
--size: 11px;
--background: #7F7F7F;
--icon: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3IiBoZWlnaHQ9IjciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci14Ij48cGF0aCBkPSJNMTggNkw2IDE4TTYgNmwxMiAxMiIvPjwvc3ZnPgo=");
-webkit-appearance: none;
height: var(--size);
width: var(--size);
border-radius: 50%;
background: var(--background) var(--icon) 50% 50% no-repeat;
}