This guide assumes a fresh install of Mac OSX 10.7 Lion.
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 "server.hpp" | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
using std::cout; | |
using std::cerr; | |
using std::cin; | |
using std::endl; | |
using std::fstream; |
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 pdb | |
""" | |
The Bellman-Ford algorithm | |
Graph API: | |
iter(graph) gives all nodes | |
iter(graph[u]) gives neighbours of u | |
graph[u][v] gives weight of edge (u, v) | |
""" |
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/env python | |
""" | |
zip.py | |
Zero-inflated Poisson example using simulated data. | |
Created by Chris Fonnesbeck on 2008-06-06. | |
Distributed under the MIT license: http://www.opensource.org/licenses/mit-license.php | |
""" |
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/env python | |
# This example demonstrates RSA public-key cryptography in an | |
# easy-to-follow manner. It works on integers alone, and uses much smaller numbers | |
# for the sake of clarity. | |
##################################################################### | |
# First we pick our primes. These will determine our keys. | |
##################################################################### |
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/env python | |
# how to unfollow everyone who isn't following you | |
# By Jamieson Becker (Public Domain/no copyright, do what you will) | |
# Easy instructions, even if you don't know Python | |
# | |
# 1. Install pip (apt-get install python-pip) and then | |
# pip install tweepy, which is the python twitter client | |
# |
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
from collections import namedtuple | |
def convert(dictionary): | |
return namedtuple('GenericDict', dictionary.keys())(**dictionary) | |
""" | |
>>> d = dictionary(a=1, b='b', c=[3]) | |
>>> named = convert(d) | |
>>> named.a == d.a | |
True | |
>>> named.b == d.b |
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
cmake_minimum_required (VERSION 2.6) | |
set(FILL_UTIL "${PROJECT_SOURCE_DIR}/utils/fill") | |
set(SIZE_UTIL "${PROJECT_SOURCE_DIR}/arch/i386/size.sh") | |
set(cpu_objects main.c task.c pgrequest.c descriptor.c thread.c tss.c interrupt.c paging.c memory.c caps.c permissions.c ttrace.c) | |
set(prt_objects print.c) | |
set(assembly_src cpu-asm.s arch/i386/kernel/int.s arch/i386/kernel/pic.s arch/i386/kernel/stack_winding.s arch/i386/kernel/state_switch.s arch/i386/kernel/syscall-gates.s arch/i386/kernel/vga.s) | |
#add_custom_command(OUTPUT assembly.o COMMAND ${AS} ${AS_FLAGS} -o assembly.o ${assembly_src}) |
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
function getJSON(aUrl,sheetname) { | |
//var sheetname = "test"; | |
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json"; | |
var response = UrlFetchApp.fetch(aUrl); // get feed | |
var dataAll = JSON.parse(response.getContentText()); // | |
var data = dataAll.value.items; | |
for (i in data){ | |
data[i].pubDate = new Date(data[i].pubDate); | |
data[i].start = data[i].pubDate; | |
} |
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
These two files should help you to import passwords from mac OS X keychains to 1password. | |
Assumptions: | |
1) You have some experience with scripting/are a power-user. These scripts worked for me | |
but they haven't been extensively tested and if they don't work, you're on your own! | |
Please read this whole document before starting this process. If any of it seems | |
incomprehensible/frightening/over your head please do not use these scripts. You will | |
probably do something Very Bad and I wouldn't want that. | |
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous | |
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they |
OlderNewer