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
#Py code | |
import cProfile | |
import urllib2 | |
def main(): | |
urllib2.urlopen('http://majorgeeks.com/page.php?id=1') | |
if __name__ == '__main__': | |
cProfile.run('main()') | |
main() |
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
#Py Code tested | |
import urllib2 | |
import cProfile | |
def main(): | |
url = "http://majorgeeks.com/page.php?id=" | |
for i in xrange(1,21): | |
tempurl = url + str(i) | |
res = urllib2.urlopen(tempurl) |
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
(defn getepoch [timestamp] | |
(int (/ (.getMillis timestamp) 1000))) |
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
(switch-to-frame 0) | |
(switch-to-active) | |
(send-keys "body" "Thanks to noidi_ :)") | |
(switch-to-default) ;This is switch back from iframe. | |
(click (find-element {:tag :button :type :submit})) ;to submit :) |
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 msg (let [s (java.io.StringWriter.)] | |
(binding [*test-out* s] | |
(with-test-out (run-tests))) | |
(str s))) | |
;Thanks to jjcomer at #clojure IRC. |
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
(ns ff.core | |
(require [clj-webdriver.taxi :as taxi] | |
[clj-webdriver.firefox :as ff])) | |
(def path-firebug "ff-extensions/firebug@software.joehewitt.com.xpi") | |
(defn init-firefox-local-driver | |
"Initializes Firefox driver. | |
And sets a global implicit-wait" |
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 BeautifulSoup import BeautifulSoup | |
import requests | |
url = "http://www.the-numbers.com/movie/%s" | |
payload = "Die-Hard-5" | |
cast = list() | |
technicals = list() | |
r = requests.get(url % payload ) | |
soup = BeautifulSoup(r.text) |
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
#!/bin/bash | |
# Imports pictures into all iOS simulators. | |
path_to_pic="src/ios/pictures/" | |
mkdir -p /Users/$(whoami)/Library/Application\ Support/iPhone\ Simulator/{5.0,5.1,6.0,6.1}/Media/DCIM/100APPLE/ | |
find ~/Library/Application\ Support/iPhone\ Simulator/ -type d -name '100APPLE' -exec cp /Users/$(whoami)/$path_to_pic/* {} \; |
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
testclj.core> (start) | |
---------------------------- | |
{platform WIN8, browserName firefox, version 21} | |
Browser firefox | |
Version 21.0 | |
Platform #< XP> | |
---------------------------- | |
{platform VISTA, browserName firefox, version 21} | |
Browser firefox | |
Version 21.0 |
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
git log --pretty=format:'%h|%ad|%an|%s' -20 --date=local | awk -F '|' '{ printf "%s %s %-20s %s\n", $1, $2, $3, $4 }' |
OlderNewer