Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ttaubert's full-sized avatar

Tim Taubert ttaubert

View GitHub Profile
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@sunnyone
sunnyone / hello-u8.rs
Last active September 20, 2021 10:13
Windows Unicode conversion in Rust
// Add to Cargo.toml
// [dependencies]
// winapi = "*"
// user32-sys = "*"
extern crate winapi;
extern crate user32;
fn from_wide_ptr(ptr: *const u16) -> String {
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
@Centril
Centril / box_callback.rs
Last active May 17, 2017 15:05
Rust: Sending callbacks in struct to a scoped thread with Box
#![feature(core)]
#![feature(std_misc)]
use std::thread::{Thread, JoinGuard};
fn callback(v: usize) -> usize { v * 2 }
struct S {
cb: Box<Fn(usize) -> usize + Send>,
}
@1-1
1-1 / OpenHashMap.java
Created December 15, 2012 17:24
HashSet with chaining
import java.math.BigInteger;
import java.util.Arrays;
public class OpenHashMap {
class Entry {
String key;
String value;
public Entry(String key, String value) {
@thoughtpolice
thoughtpolice / Makefile
Created August 28, 2015 20:05
BLAKE-256 Cryptol Specification with SAW Script verification
CC=clang
all:
$(CC) -emit-llvm -o blake256.bc -c blake256.c
saw blake256.saw
clean:
rm -f *.bc *~
@int3
int3 / hashtable.c
Created December 10, 2012 17:34
Simple open-addressed hashtable
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
// no actual pointer should have this value, due to alignment
static void* DELETED = (void*)1;
static int TABLE_SIZE = 701;
@brendandahl
brendandahl / go.sh
Created October 2, 2012 17:30
Build pdf.js and Copy to Gaia
#!/bin/sh
pushd .;
cd ~/projects/mine/pdf.js
node make b2g
cp -R ~/projects/mine/pdf.js/build/b2g/content ~/projects/mine/gaia/apps/pdfjs/;
cd ~/projects/mine/gaia
rm -rf profile
make
/Applications/B2G.app/Contents/MacOS/b2g -jsconsole -profile ~/projects/mine/gaia/profile/
popd;
@yurydelendik
yurydelendik / gist:3764535
Created September 21, 2012 23:41
alias for .git/config to squash commits
[alias]
squash = !sh -c 'git checkout mozilla/master && git merge --no-commit --squash $0 && git checkout -B $0 && git commit -e'
@DouglasSherk
DouglasSherk / mac_address_randomize.sh
Last active August 29, 2015 13:56
MAC Address Randomizer
#!/usr/bin/bash
# You might want to note your old MAC address here. Use this to get it:
# ifconfig en0 | grep ether
MAC_ADDRESS=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
echo "Setting MAC address..."
sudo ifconfig en0 ether $MAC_ADDRESS
ifconfig en0 | grep ether