Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* | |
* scwrap 環境変数にシステム設定を入れてくれるいい感じのアレ | |
* | |
* 使い方: scwrap cmd [cmdargs..] | |
* | |
* 例(希望): sudo scwrap port selfupdate | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> |
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 Control.Monad | |
import Control.Applicative | |
import Control.Monad.State | |
import Control.Monad.Writer | |
newtype A = A [B] deriving(Show) | |
newtype B = B Int deriving(Show) | |
type Checker a = StateT Int (WriterT [String] Maybe) a |
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 <Cocoa/Cocoa.h> | |
@class Hoge; | |
typedef Hoge *(^setter)(int); | |
@interface Hoge : NSObject | |
@property int a,b; | |
@property (nonatomic, readonly, copy) setter setA; | |
@property (nonatomic, readonly, copy) setter setB; |
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
def load_module(m): | |
import imp | |
try: | |
f, p,d = imp.find_module(m) | |
return imp.load_module(m, f, p, d) | |
except: | |
return None | |
random = load_module("random") | |
hoge = load_module("hoge") |
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
// -*- coding: utf-8 -*- | |
/** | |
* @param {function} f funciton. | |
* @return {String[]} argument names. | |
*/ | |
function argNames(f) { | |
var re = /^[\s\(]*function[^(]*\((.*?)\)/; | |
var args = f.toString().match(re)[1].split(','); | |
return args.map(function(e) { |
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
# -*- coding: utf-8 -*- | |
from selenium import webdriver | |
from selenium.webdriver.support.ui import Select | |
from selenium.webdriver.common.alert import Alert | |
import os | |
import sys | |
import mechanize | |
import random | |
import re | |
import time |
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 tumblrnotes as tn | |
import igraph | |
import re | |
import sys | |
import os | |
def notes(url): | |
def prittyfy(li): | |
for r in li.findall("blockquote"): | |
li.remove(r) |
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 -*- | |
import urllib2 | |
import urllib | |
import urlparse | |
import re | |
import lxml.html | |
class Thumbnail: | |
"""pixiv thumbnails and some information""" |
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
NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://tumblr.com"]] | |
returningResponse:nil | |
error:nil]; | |
[data writeToFile:@"text.html" atomically:YES]; |