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
<?php | |
//settings | |
define('DB_NAME', ''); //db name | |
define('DB_USER', 'root'); | |
define('DB_PWD', ''); | |
define('TABLE_NAME', ''); | |
define('IP_FIELD', 'ip'); // the field for visitor's ip address | |
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 | |
#!/usr/bin/python | |
import requests | |
import re | |
import sqlite3 | |
from bs4 import BeautifulSoup | |
def has_same_record(source="cambridge", incident_no='', report_time='', report_date=''): | |
conn = sqlite3.connect('policelog.sqlite') |
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
on run {input, parameters} | |
(* Your script goes here *) | |
tell application "Finder" | |
make new file at (target of front window as alias) | |
end tell | |
end run |
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
/// | |
// usage : | |
// scrape the list - casperjs scrape_mass_court_decisions.js scrape [the number of starting case] | |
// fetch the detail record - casperjs scrape_mass_court_decisions.js detail [the number of starting case] | |
// find the missing items - casperjs scrape_mass_court_decisions.js rinse | |
var casper = require('casper').create(); | |
//var casper = require('casper').create({ | |
// verbose: true, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Audio jack</title> | |
</head> | |
<body> | |
<script> | |
if (!navigator.getUserMedia) | |
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || |
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
/* | |
Dispatcher module | |
by: wangyu ([email protected]) | |
dispatch global event | |
usage: | |
- fire an event: | |
dispatcher.dispatch('example.event.name', arg1, arg2...) | |
- subscribe an event: | |
dispatcher.subscribe('example.event.name', function(arg1, arg2...){}); |
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
/* | |
JSRequire module | |
by: wangyu ([email protected]) | |
manage javascript dependancies. | |
usage: | |
jsrequire(['one.js', 'two.js'], function(){ | |
// code after one.js and two.js loaded... | |
}); | |
*/ |
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 <Foundation/Foundation.h> | |
@interface UIImage (Resize) | |
- (UIImage *)resizeTo:(CGSize)newSize; | |
@end |
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 <Foundation/Foundation.h> | |
@interface UIImage (Tint) | |
- (UIImage *)tintedImageWithColor:(UIColor *)tintColor; | |
@end |
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 <Foundation/Foundation.h> | |
@interface UIColor (HexString) | |
+ (UIColor *) colorFromHexString:(NSString *)hexString; | |
@end |
OlderNewer