This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=clang | |
all: | |
$(CC) -emit-llvm -o blake256.bc -c blake256.c | |
saw blake256.saw | |
clean: | |
rm -f *.bc *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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>, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
import java.util.Arrays; | |
public class OpenHashMap { | |
class Entry { | |
String key; | |
String value; | |
public Entry(String key, String value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
squash = !sh -c 'git checkout mozilla/master && git merge --no-commit --squash $0 && git checkout -B $0 && git commit -e' |
NewerOlder