Skip to content

Instantly share code, notes, and snippets.

[alias]
st = status
ci = commit
br = branch
co = checkout
unstage = reset HEAD
uncommit = reset --soft HEAD^
# When doing "git git log" or some such, do not complain about "git" not
# being a valid Git command. This happens when copy-pasting examples, for
@auchenberg
auchenberg / dependency-list-generator
Created July 28, 2014 12:16
A quick script to generate a JSON blob of dependencies with license info from Bower/NPM.
var fs = require('fs');
var npm = require('npm');
var bower = require('bower');
var Q = require('q');
var npmConfig = JSON.parse(fs.readFileSync('package.json'));
var bowerConfig = JSON.parse(fs.readFileSync('bower.json'));
function gatherNpmInfo(dependencies) {
DOESNT WORK:
POST /api/session HTTP/1.1
Host: dev.g2m.me:8243
Authorization: Basic Y2l0cml4Og==
Cache-Control: no-cache
Postman-Token: 24a359ae-4725-5106-711c-b6334ddcb729
Content-Type: application/x-www-form-urlencoded
<a
class="add-this-event-link"
href="#"
title="Add to Calendar"
data-start="10-05-2014 11:38:46"
data-end="11-05-2014 11:38:46"
data-timezone="Copenhagen/Europe"
data-title="Summary of the event"
data-description="Description of the event"
data-location="Location of the event"
@auchenberg
auchenberg / callstats.io
Created November 27, 2014 15:21
Callstats.js
(function(e) {
var t = function(e, t, n) {
function F(e, t, n, r, i) {
function u(u) {
var a = (new Date).getTime(),
c = {};
c.version = s, c.appID = o, c.conferenceID = encodeURIComponent(n), c.apiTS = a, r !== undefined && (c.ucID = r), f && (c.token = f.token), c.localID = encodeURIComponent(e), c.remoteID = encodeURIComponent(t), c.endpointID = l, c.browser = {
name: v.name,
ver: v.ver,
os: v.os
@auchenberg
auchenberg / gist:088c235a6e25fa567f7a
Last active August 29, 2015 14:13
Hello interface
var hello = require('hello');
var options = {
txtRecord: {},
subtypes: []
};
// Announce service (callback)
hello.announce('remotedebug', 'tcp', 9222, options, function(err, response) {
if(err) {
@auchenberg
auchenberg / gist:62c879ead540c36a0e32
Created March 11, 2015 14:39
Steps how to find Chrome-powred remote debug devices using ADB
adb devices
adb -s <device> shell “cat /proc/net/unix |grep devtools_remote”
adb -s <device> forward tcp:9222 local abstract:<service name>
def latitude
token = 'latisquare.kenneth.io'
secret = ''
consumer = OAuth::Consumer.new(token,secret, {
:site => "https://www.google.com",
:scheme => :header,
:http_method => :post,
:request_token_path => "/accounts/OAuthGetRequestToken",
require 'rubygems'
require 'sinatra'
require 'oauth2'
require 'json'
def new_client
OAuth2::Client.new('CLIENT ID', 'CLIENT SECRET', :site => 'https://github.com',
:authorize_path => '/login/oauth/authorize', :access_token_path => '/login/oauth/access_token')
end
html {
}
.image-block {
vertical-align: top;
margin: 0px;
}