Skip to content

Instantly share code, notes, and snippets.

Avatar

Larz Conwell larzconwell

View GitHub Profile
View gist:9624785
package main
import (
"fmt"
"github.com/peterh/liner"
)
func main() {
state := liner.NewLiner()
line, err := state.Prompt("> ")
View gist:8305641
alias update="sudo apt-get update"
alias upgrade="update && sudo apt-get upgrade"
alias dist-upgrade="upgrade && sudo apt-get dist-upgrade"
alias install="sudo apt-get install ${@:2}"
alias uninstall="sudo apt-get purge ${@:2}"
alias search="apt-cache search ${@:2}"
View gist:7997198
; Write contents from stdin to a given file
section .rodata
errnofile: db "No filename given", 10
errnofilelen: equ $ - errnofile
errnocreate: db "Couldn't create file", 10
errnocreatelen: equ $ - errnocreate
errnowrite: db "Couldn't write file", 10
errnowritelen: equ $ - errnowrite
section .bss
View gist:7904573
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static char *strs[] = {"example", "another", "hi"};
static int strc = 3;
int main(void) {
int i = 0;
int size = 1;
View gist:7653454
global _start
extern main
section .text
_start:
call main
mov ebx, eax ; EAX HOLDS THE FUCKING RETURN STATUS, OMG
mov eax, 1
int 0x80
@larzconwell
larzconwell / gist:7629514
Created Nov 24, 2013
Binary Clock(update minute and hour variable with current time before writing to device).
View gist:7629514
/*
Layout of pins:
3 10
4 7 11
1 5 8 12
2 6 9 13
*/
#include <EEPROM.h>
int startupDone = 0;
@larzconwell
larzconwell / gist:6941140
Created Oct 11, 2013
Moln Client example
View gist:6941140
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"net/http"
"net/url"
"os"
View gist:6541241
#!/usr/bin/env bash
if [[ "${APP_FILE}" == "" ]]; then
APP_FILE="app3.js"
fi
echo "TTNRT : about to forever start ${APP_FILE}"
if [[ "${1}" == "start" ]]; then
echo "Starting: ${APP_FILE}"
View gist:6158099
var async = require('async');
function some (items, iterator) {
var ret = -1,
v;
for (var i in items) {
v = iterator(items[i]);
if (v) {
@larzconwell
larzconwell / gist:6076307
Last active Dec 20, 2015
A new shell language reference/specification
View gist:6076307

Hive

Comments

# Single-line comments

##
  Multi-line comments
##