Skip to content

Instantly share code, notes, and snippets.

Tim Taubert ttaubert

Block or report user

Report or block ttaubert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thoughtpolice
thoughtpolice / Makefile
Created Aug 28, 2015
BLAKE-256 Cryptol Specification with SAW Script verification
View Makefile
CC=clang
all:
$(CC) -emit-llvm -o blake256.bc -c blake256.c
saw blake256.saw
clean:
rm -f *.bc *~
@sunnyone
sunnyone / hello-u8.rs
Last active May 20, 2017
Windows Unicode conversion in Rust
View hello-u8.rs
// 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
Rust: Sending callbacks in struct to a scoped thread with Box
View box_callback.rs
#![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>,
}
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active Oct 13, 2019
OSX for Hackers (Mavericks/Yosemite)
View osx-for-hackers.sh
# 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
@DouglasSherk
DouglasSherk / mac_address_randomize.sh
Last active Aug 29, 2015
MAC Address Randomizer
View mac_address_randomize.sh
#!/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
@1-1
1-1 / OpenHashMap.java
Created Dec 15, 2012
HashSet with chaining
View OpenHashMap.java
import java.math.BigInteger;
import java.util.Arrays;
public class OpenHashMap {
class Entry {
String key;
String value;
public Entry(String key, String value) {
@int3
int3 / hashtable.c
Created Dec 10, 2012
Simple open-addressed hashtable
View hashtable.c
#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 Oct 2, 2012
Build pdf.js and Copy to Gaia
View go.sh
#!/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 Sep 21, 2012
alias for .git/config to squash commits
View gist:3764535
[alias]
squash = !sh -c 'git checkout mozilla/master && git merge --no-commit --squash $0 && git checkout -B $0 && git commit -e'
You can’t perform that action at this time.