Skip to content

Instantly share code, notes, and snippets.

View laiso's full-sized avatar
☀️

laiso laiso

☀️
View GitHub Profile
/**
* # USAGE
*
* phantomjs ./google_search.js 'javascript'
*
* phantomjs ./google_search.js 'Steven Jobs' > result.csv
*
*/
var BASE_URL = 'http://www.google.co.jp/search?';
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @see https://github.com/Schnouki/twitscreen
import urlparse
import pygtk
pygtk.require('2.0')
import gtk, gtkimageview, os, tempfile, webbrowser
//
// USAGE:
// phantomjs ./login_facebook.js
//
// EXAMPLE:
// phantomjs login_facebook.js | growl -t 'Facebook Auto Login' -H localhost
// phantomjs login_facebook.js | cowsay -f daemon | growl -t 'Facebook Auto Login' -H localhost
// while; do; phantomjs login_facebook.js | cowsay -f daemon | growl -t 'Facebook Auto Login' -H localhost && sleep 180 ; done
//
// SCREENSHOT:
>>
Hi,
We apologize, but the only way we will be able to verify ownership of this account is if you reply to this email with an attached color image of your government-issued photo identification confirming your full name and date of birth. Rest assured that we will permanently delete your ID from our servers once we have used it to verify the authenticity of your account.
Please note that we will not be able to process your request unless you send in proper identification. We apologize for any inconvenience this may cause.
Thanks,
<<
#import <UIKit/UIKit.h>
@interface UIWebViewBaseTest : NSObject <UIApplicationDelegate> {
UIWebView* web;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UIWebView* web;
@laiso
laiso / appengine+zc.buildout+pytest.buildout.cfg
Created August 11, 2011 04:35
[雑記]Google App Engine + zc.buildout でpytest テストランナーをつくる
# appengine+zc.buildout+pytest.buildout.cfg
#
# cp -r google_appengine/new_project_template ./src
# python2.5 bootstrap.py -d -c appengine+zc.buildout+pytest.buildout.cfg
# ./bin/buildout -v -c appengine+zc.buildout+pytest.buildout.cfg
#
# # add src/tests.py
# # @see http://pytest.org/
#
# ./bin/run_tests src/tests.py
@laiso
laiso / tw3.py
Created August 23, 2011 03:07 — forked from yoshiori/tw3.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time, random, urllib, urllib2, cgi, hmac, hashlib, commands, simplejson
from pit import Pit
class MyTwitter(object):
request_token_url = 'http://twitter.com/oauth/request_token'
@laiso
laiso / UIWebView+BacicAuth.m
Created September 12, 2011 18:19
UIWebView を使って BASIC認証のあるページにアクセスする
// NOTE: 望んだように動かない……
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIWebView* webView = [[[UIWebView alloc] initWithFrame:self.window.frame] autorelease];
webView.delegate = self;
NSString* url = @"http://example.com/authorization";
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
[self.window addSubview:webView];
@laiso
laiso / main.py
Created September 13, 2011 11:29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path[:0] = ['.', ]
# secret.py
from secret import (
ID, PASSWORD,
)
@laiso
laiso / HogeSomeViewController.m
Created September 14, 2011 13:46
[雑記] UIWebViewのスクロールを無効にする
// こんな感じ??
UIWebView* _webView = [[[UIWebView alloc] init] autorelease];
UIScrollView* webScrollView = [[_webView subviews] lastObject];
if([webScrollView respondsToSelector:@selector(setScrollEnabled:)]){
[webScrollView setScrollEnabled:NO];
}
// lastObject がUIScrollView だとは限らない??
UIWebView* _webView = [[[UIWebView alloc] init] autorelease];