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
var ts = new Date(); | |
var diff = 0; | |
var count = 0; | |
var callMe = function() { | |
var localTs = new Date(); | |
diff = localTs.getTime() - ts.getTime(); | |
ts = localTs; | |
console.log('Diff:' + diff); |
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
Assert.Equal\({.+}, {.+}, .+\); | |
Assert.Equal(\1, \2); | |
Assert.NotNull\({.+}, .+\); | |
Assert.NotNull(\1); | |
Assert.GreaterThan\({.+}, {.+}\); | |
Assert.True(\1 > \2); | |
-- |
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
C:\Users\kian>tracert www.twitter.com | |
Tracing route to twitter.com [199.59.148.10] | |
over a maximum of 30 hops: | |
1 <1 ms <1 ms <1 ms 172.16.155.2 | |
2 * * * Request timed out. | |
3 * * * Request timed out. | |
4 * ^C |
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
echo "====== REQUEST HEADERS =====" . PHP_EOL; | |
var_dump($client->__getLastRequestHeaders()); | |
echo "========= REQUEST ==========" . PHP_EOL; | |
var_dump($client->__getLastRequest()); | |
echo "========= RESPONSE =========" . PHP_EOL; | |
var_dump($response); |
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
public void GoogleGeoCode(string address, out double lat, out double lon) | |
{ | |
string url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" + address; | |
var req = (HttpWebRequest)WebRequest.Create(url); | |
var reader = new StreamReader(req.GetResponse().GetResponseStream()); | |
var body = reader.ReadToEnd(); | |
lat = double.Parse(Regex.Match(body, @"""lat\"" : ([\d\.]+)").Groups[1].Value); |
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 'rexml/document' | |
edmx = File.read(ARGV.first) | |
doc = REXML::Document.new(edmx) | |
mapped = [] | |
constrained = [] | |
doc.elements.each('edmx:Edmx/edmx:Runtime/edmx:ConceptualModels/Schema/Association') do |ele| |
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 'mechanize' | |
module CCCB::Core::TwitterMessage | |
extend Module::Requirements | |
TWITTER_REGEX = /twitter.com\/(?<name>[A-Za-z0-9_]*)\//i | |
needs :bot, :links |
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 'mechanize' | |
module CCCB::Core::TwitterMessage | |
extend Module::Requirements | |
TWITTER_REGEX = /twitter.com\/(?<name>[A-Za-z0-9_]*)\//i | |
needs :bot, :links |
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
for file in Terry*.epub; do echo $file; unzip -p "$file" | egrep -no '(\w+\s+)+force(\s+\w+)+'; done |
OlderNewer