This file contains hidden or 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
| # Parses YouTube URLs directly or from iframe code. Handles: | |
| # * Address bar on YouTube url (ex: http://www.youtube.com/watch?v=ZFqlHhCNBOI) | |
| # * Direct http://youtu.be/ url (ex: http://youtu.be/ZFqlHhCNBOI) | |
| # * Full iframe embed code (ex: <iframe src="http://www.youtube.com/embed/ZFqlHhCNBOI">) | |
| # * Old <object> tag embed code (ex: <object><param name="movie" value="http://www.youtube.com/v/ZFqlHhCNBOI">...) | |
| /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/ | |
| $5 #=> the video ID | |
| # test it on Rubular: http://rubular.com/r/eaJeSMkJvo |
This file contains hidden or 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 | |
| // Licence: Do Whatever The Fuck You Want! http://www.wtfpl.net/about/ | |
| // Author: Your bro! | |
| $fbAuth = array("facebook_id" => "123456789", "facebook_token" => "<Use charles proxy to do man-in-middle SSL sniffing and extract fb token>"); | |
| // Do the magic. | |
| $tinderToken = tinderCall("auth", "token", $fbAuth); // Authenticate |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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 CodeEval, test cases are read in from a file which is the first argument to your program | |
| # Open the file and read in line by line. Each line represents a different test case | |
| # (unless given different instructions in the challenge description) | |
| import sys | |
| test_cases = open(sys.argv[1], 'r') | |
| for test in test_cases: | |
| # ignore test if it is an empty line |
This file contains hidden or 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 | |
| /** | |
| * Google Code Jam 2012 | |
| * | |
| * @author Kien Pham - [email protected] | |
| */ | |
| $C = new CodeJam(); | |
| $C->run(); |