Skip to content

Instantly share code, notes, and snippets.

View jenrzzz's full-sized avatar

Jenner La Fave jenrzzz

View GitHub Profile
.file "test.c"
.section ".text"
.align 4
.global float_1
.type float_1, #function
.proc 06
float_1:
save %sp, -96, %sp
st %i0, [%fp+68]
st %i1, [%fp+72]
#include <stdio.h>
float float_1( float a, float b ) {
return a + b;
}
float float2( float a, float b ) {
return a + b;
}
@jenrzzz
jenrzzz / test.s
Last active December 17, 2015 18:18
.section ".data"
.global fmt
fmt:
.asciz "uninit value: %d\n"
.section ".bss"
.global a
a: .skip 4
.section ".text"
@jenrzzz
jenrzzz / gist:5588205
Created May 15, 2013 23:19
tmux session switcher function
function sesh() {
if [[ $# -gt 0 ]]; then
case "$1" in
new)
tmux new -s "$2"
;;
*)
if tmux list-sessions | grep "attached"; then
tmux switch -t "$1"
else
@jenrzzz
jenrzzz / client.go
Created April 16, 2013 06:46
199 Go sockets practice
package main
import ("net"; "fmt"; "log")
func main() {
conn, err := net.Dial("tcp", "localhost:9999")
if err != nil {
log.Panic(err)
}
@jenrzzz
jenrzzz / gist:3308273
Created August 9, 2012 21:40
puppet host lookup
require 'resolv'
module Puppet::Parser::Functions
newfunction(:get_ip_addr, :type => :rvalue) do |args|
# Super sexy regex to match valid IPs
ip_addr_re = /\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/
hostname = args[0].strip
if hostname =~ ip_addr_re then return hostname end
begin
Resolv::DNS.open { |dns| return dns.getaddress hostname }
@jenrzzz
jenrzzz / gist:2876718
Created June 5, 2012 18:25
Normalize row height
$(document).ready(function() {
$('.normheight').css({
'height': $('.normheight').height()
});
});