- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
var Jaxy = function() { | |
this.xhr = new XMLHttpRequest; | |
}; | |
Jaxy.prototype.get = function(options) { | |
if (typeof options.url === 'undefined') return; | |
var self = this; | |
var url = options.url || ''; | |
var success = options.success || null; | |
var error = options.error || null; |
# Just an example. | |
# @video is a direct reference to a '<video>' element. | |
# $() is assuming jQuery is being used in this example. | |
@video.addEventListener("loadedmetadata", (event) => | |
actualRatio = @video.videoWidth/@video.videoHeight | |
targetRatio = $(@video).width()/$(@video).height() | |
adjustmentRatio = targetRatio/actualRatio | |
$(@video).css("-webkit-transform","scaleX(#{adjustmentRatio})") | |
) |
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com |
'use strict'; | |
// Add ECMA262-5 method binding if not supported natively | |
// | |
if (!('bind' in Function.prototype)) { | |
Function.prototype.bind= function(owner) { | |
var that= this; | |
if (arguments.length<=1) { | |
return function() { | |
return that.apply(owner, arguments); |
# Blank Metro Template, but in CoffeeScript | |
# Just a dumb rewrite of the default.js in | |
# http://msdn.microsoft.com/en-us/library/windows/apps/hh986964.aspx | |
buttonClickHandler = (eventInfo) -> | |
userName = document.getElementById("nameInput").value | |
greetingString = "Hello, #{userName}!"; # oh yeah, CS does string interpolation | |
document.getElementById("greetingOutput").innerText = greetingString | |
app = WinJS.Application |
#!bash.exe | |
export SSH_AUTH_SOCK=/tmp/.ssh-socket | |
echo ; | |
echo Starting connection with ssh-agent... | |
ssh-add -l 2>&1 >/dev/null | |
if [ $? = 2 ]; then | |
rm -f /tmp/.ssh-script /tmp/.ssh-agent-pid /tmp/.ssh-socket | |
# Exit status 2 means couldn't connect to ssh-agent; start one now | |
echo Creating new ssh-agent... | |
ssh-agent -a $SSH_AUTH_SOCK > /tmp/.ssh-script |
Bacon.Observable.prototype.fold = function(seed, f) { | |
var scanned = this.scan(seed, f) | |
return scanned.changes().mapEnd().map(scanned) | |
} |
$ = jQuery | |
TRANSFORM_TYPES = ['PUT', 'POST', 'DELETE'] | |
$.activeTransforms = 0 | |
$(document).ajaxSend (e, xhr, settings) -> | |
return unless settings.type in TRANSFORM_TYPES | |
$.activeTransforms += 1 |