Skip to content

Instantly share code, notes, and snippets.

View alexkolson's full-sized avatar

Alex Olson alexkolson

  • Lufthansa Technik
  • Hamburg
View GitHub Profile
alias.lg1=log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
alias.lg2=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
This bot does not store any personally identifiable information about you.
[push]
default = current
[core]
editor = code --wait
autocrlf = input
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
[pull]
@alexkolson
alexkolson / ako-run-dev.sh
Created July 27, 2016 10:44
An unobtrusive utility script to run loopback apps with nodemon for debugging purposes.
#!/usr/bin/env bash
main() {
read -r -d '' nodemonjson <<EOF
{
"ignoreRoot": [".git", ".nyc_output", "nodemon.json"]
}
EOF
trap "uninstall_nodemon" INT
npm install nodemon
@alexkolson
alexkolson / skk_event_example.krl.js
Last active December 21, 2015 00:58
KRL rule that responds to an event (HTTP GET request) and returns some HTML.
// This rule would respond to an HTTP GET request to the following URL structure:
// https://cs.kobj.net/sky/event/CLOUD_ECI/EVENT_IDENTIFIER/andy_event/example_html/
// Where CLOUD_ECI is the event channel identifier for the cloud you want to raise this event into, and
// EVENT_IDENTIFIER is any unique identifier for an event. It can be anything as long as its unique.
// So for example, if my cloud ECI was 7B59AF40-AD1D-11E2-9896-9A82E71C24E1, I could trigger this rule by doing an HTTP GET to:
// https://cs.kobj.net/sky/event/7B59AF40-AD1D-11E2-9896-9A82E71C24E1/123456/andy_event/example_html/
// Note that any ruleset installed into this cloud could also respond to the example_html event
rule example_html_response {
@alexkolson
alexkolson / fun_js_experiment.js
Last active December 21, 2015 00:09
Fun Javascript experiment I did over the weekend. It's a programming problem (finding the longest non-decreasing sequence in a grid) I came across and I wanted to give it a shot. This is my first iteration, so obviously it could do with some optimizations. My first inclination was to do this in C++ but I wanted to test Atwood's Law, that is, if …
(function($) {
"use strict";
var day_lookup = {
"0": "Sunday",
"1": "Monday",
"2": "Tuesday",
"3": "Wednesday",
"4": "Thursday",
"5": "Friday",
{
"Person" :
{
"what" : "Contact information for a person",
"defaultapps" : [
"a169x625.prod",
"a169x664.prod",
"a169x676.prod",
"a16x161.prod",
"a41x178.prod",
@alexkolson
alexkolson / krl_facebook_send_button_placement.krl.js
Created April 27, 2011 03:26
Placing the send button on any page using KRL
rule append_send_button {
select when pageview ".*"
{
emit <|
$KOBJ("body").append('<fb:send href="exampley.com" font="Arial"></fb:send>'); // href is the link to send. Can be any valid url. Maybe even location.host? ;)
var head = $KOBJ("head").get(0); // or just document.getElementsByTagName("head")[0], but I <3 jQuery
var script = document.createElement("script");
script.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
head.appendChild(script);
|>;
ruleset a876x16 {
meta {
name "Flickr Dataset Tutorial"
description <<
Dataset tutorial using the Flickr Public Feed
>>
author "Brad Hintze"
logging off
}
ruleset a876x16 {
meta {
name "Flickr Dataset Tutorial"
description <<
Dataset tutorial using the Flickr Public Feed
>>
author "Brad Hintze"
logging on
}