Skip to content

Instantly share code, notes, and snippets.

View larzconwell's full-sized avatar

Larz Conwell larzconwell

View GitHub Profile
package main
import (
"fmt"
"github.com/peterh/liner"
)
func main() {
state := liner.NewLiner()
line, err := state.Prompt("> ")
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}"
; 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
#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;
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 November 24, 2013 17:05
Binary Clock(update minute and hour variable with current time before writing to device).
/*
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 October 11, 2013 20:02
Moln Client example
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"net/http"
"net/url"
"os"
#!/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}"
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 December 20, 2015 05:09
A new shell language reference/specification

Hive

Comments

# Single-line comments

##
  Multi-line comments
##