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 | |
""" | |
Given n people what's the probability that there is a | |
birthday on each day of the year (assuming equal prob | |
for each day & no leap year)? | |
""" | |
import random |
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
// Compile run with: | |
// cc piper.c -o piper ; ./piper | |
// From Season 3 Episode 1 of HBO's Silicon Valley | |
#include <stdio.h> | |
#include <stdlib.h> | |
void _ctx_iface(__int128_t s, int i) | |
{ |
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
3a: 89 04 24 mov %eax,(%esp) | |
3d: 31 db xor %ebx,%ebx | |
3f: 89 58 02 mov %ebx,0x2(%eax) | |
42: bb 08 a0 04 08 mov $0x804a008,%ebx | |
47: 8b 03 mov (%ebx),%eax | |
49: bb ff ff ff 7f mov $0x7fffffff,%ebx | |
4e: 81 eb 2f 59 fc 7f sub $0x7ffc592f,%ebx | |
54: 29 d8 sub %ebx,%eax | |
56: 83 ec 04 sub $0x4,%esp | |
59: ff e0 jmp *%eax |
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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
UIView *holderView = [[UIView alloc] initWithFrame:CGRectMake(50.0f, 50.0f, 200.0f, 200.0f)]; | |
CAEmitterLayer *emitterLayer = [CAEmitterLayer layer]; | |
emitterLayer.frame = CGRectMake(0.0f, 0.0f, 200.0f, 200.0f); | |
emitterLayer.emitterSize = CGSizeMake(20.0f, 20.0f); | |
emitterLayer.emitterPosition = CGPointMake(90.0f, 90.0f); | |
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 — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Set computer name (as done via System Preferences → Sharing) | |
scutil --set ComputerName "MathBook Pro" | |
scutil --set HostName "MathBook Pro" | |
scutil --set LocalHostName "MathBook-Pro" |
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
#ios simulator helpers | |
_install-cert() { | |
if [ -f "$SQLITEDBPATH" ]; then | |
cp -n "$SQLITEDBPATH" "$SQLITEDBPATH.charlesbackup" | |
sqlite3 "$SQLITEDBPATH" <<EOF | |
INSERT INTO "tsettings" VALUES(X'189B6E28D1635F3A8325E1E002180DBA2C02C241',X'3123302106035504030C1A436861726C65732050726F78792053534C2050726F7879696E6731243022060355040B0C1B687474703A2F2F636861726C657370726F78792E636F6D2F73736C3111300F060355040A0C08584B3732204C74643111300F06035504070C084175636B6C616E643111300F06035504080C084175636B6C616E64310B3009060355040613024E5A',X'3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D225554462D38223F3E0A3C21444F435459504520706C697374205055424C494320222D2F2F4170706C652F2F44544420504C49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E636F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C706C6973742076657273696F6E3D22312E30223E0A3C61727261792F3E0A3C2F706C6973743E0A',X'3082045E30820346A003020102020101300D06092A864886F70D01010505003081913123302106035504030C1A436861726C6573205072 |
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 | |
# | |
# Copyright (c) 2010 Warren Merrifield | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 bash | |
## | |
# Install: | |
# curl -sL https://raw.github.com/gist/2108403/fast.sh | sh | |
# | |
# Share your feedbacks on: | |
# https://gist.github.com/2108403 | |
# | |
# Author: @DAddYE (Twitter/Github) |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
""" | |
Used to create a single mp3 file for the various NPR news shows that are not on | |
iTunes as a podcast. | |
Dependency on: | |
mp3wrap which can be installed with your favorite package manager | |
""" | |
import os | |
import os.path |
NewerOlder