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
require "formula" | |
class UniversalBrewedPython < Requirement | |
satisfy { archs_for_command("python").universal? } | |
def message; <<-EOS.undent | |
A build of GDB using a brewed Python was requested, but Python is not | |
a universal build. | |
GDB requires Python to be built as a universal binary or it will fail |
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
clang -dynamiclib -framework AppKit patch.m -arch i386 -arch x86_64 -o patch.dylib |
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 dis | |
def while_1(): | |
while 1: | |
pass | |
def while_true(): | |
while True: | |
pass |
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 | |
# -*- coding: utf-8 -*- | |
"""Needleman-Wunsch algorithm""" | |
from __future__ import print_function, unicode_literals | |
import sys | |
score_match = 2 | |
score_miss = -1 |
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
query=vim | |
time bash -c "for i in {0..1000}; do which $query; done >/dev/null 2>&1" | |
time bash -c "for i in {0..1000}; do command -v $query; done >/dev/null 2>&1" | |
time bash -c "for i in {0..1000}; do type $query; done >/dev/null 2>&1" | |
time bash -c "for i in {0..1000}; do hash $query; done 2>/dev/null" | |
time zsh -c "for i in {0..100000}; do which $query; done >/dev/null 2>&1" | |
time zsh -c "for i in {0..100000}; do command -v $query; done >/dev/null 2>&1" | |
time zsh -c "for i in {0..100000}; do type $query; done >/dev/null 2>&1" | |
time zsh -c "for i in {0..100000}; do hash $query; done 2>/dev/null" |
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 | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import calendar | |
import datetime | |
import time | |
import pytz | |
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 __future__ import unicode_literals | |
import os | |
import sys | |
import requests | |
def get_emojis(token): | |
response = requests.get("https://slack.com/api/emoji.list", |
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
private func example1() { | |
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
for i in 0..<10 { | |
dispatch_async(queue) { | |
NSLog("Start: \(i)") | |
sleep(3) | |
NSLog("End: \(i)") | |
} | |
} | |
} |
OS X の標準の Python 環境は Python 3 が入っていないので Homebrew 等でインストールしましょう.
http://brew.sh/index_ja.html を参考に
OlderNewer