Skip to content

Instantly share code, notes, and snippets.

@benjic
benjic / fib.asm
Created September 30, 2014 18:43
.section __TEXT,__text,regular,pure_instructions
.globl _sum
.align 4, 0x90
_sum: ## @sum
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
; Declare global variables
section .data
hello: db 'Hello world!',10
helloLen: equ $-hello
; Jump into the action
section .text
global _start
; Meat and potatoes
boolean tangent = false;
float theta = 0;
float radius = 100;
float x_t = 0;
float y_t = 0;
float x_0;
float y_0;
@benjic
benjic / test.go
Last active August 29, 2015 14:05
package main
import "fmt"
func main() {
fmt.Println("Hello all vim!")
}
@benjic
benjic / test.go
Last active August 29, 2015 14:05
package main
import "fmt"
func main() {
fmt.Println("Hey look, all vim!")
}
/*
* AlternativeTrip.java
* Date: 10/17/13
* Author: Benjamin Campbell <[email protected]>
* Abstract: A simple application that allows users to submit travel
* mechanisms that implement the BUsWalkBike class.
*/
package com.benjica.csci135.hw4;
@benjic
benjic / ExampleClass.java
Created September 20, 2013 21:45
A sample use of a GIST to share code segements with other people.
package com.benjica.example
public class ExampleClass {
private final String PLACE = "World";
public static void main(String[] arguments) {
System.out.println("Hello " + PLACE + "!");
}
}
@benjic
benjic / ProcessISOs.sh
Created July 12, 2013 02:41
A simple shell script to batch process ISOs. I use it with cron to schedule every night.
#/bin/bash
cd /home/benji/Videos;
for f in *.iso;
do
HandBrakeCLI -i $f -o `basename $f .iso`.mp4 --preset "Android";
if [ $? = 0 ]; then
rm -f $f;
fi
@benjic
benjic / sample.go
Last active December 18, 2015 18:19 — forked from codeeval/sample.py
package main
/*
Here is a sample construct that reads a file name supplied as an argument and
allows you, the programmer, to easily work with the supplied parameters. Have Fun!
*/
import (
"bufio"
"os"
@benjic
benjic / sumAn.go
Created February 10, 2013 16:15
A small function for summing the first n terms of the function 2 + 2n.
package main
func sumAn( n int) int {
sum := 0
for i := 0; i < n; i++ {
sum += 2 + (2 * i)
}
return sum