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
| // Sometimes solves kortaggio's 5x5 variant of 2048: http://kortaggio.github.io/2048/ | |
| // Open the javascript console with F12 and copy past this in. | |
| // export the game manager into the global namespace | |
| GameManager.prototype.__original_actuate = GameManager.prototype.actuate; | |
| GameManager.prototype.actuate = function() { | |
| window.gm = this; | |
| this.__original_actuate(); | |
| GameManager.prototype.actuate = GameManager.prototype.__original_actuate; | |
| }; |
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
| # sending | |
| # SMTP use the univ serv | |
| set smtp_url="smtp://j53sun@mailservices.uwaterloo.ca:587" | |
| set ssl_starttls=yes | |
| set ssl_force_tls=yes | |
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
| r = session.query(ClaimRoom)[-1] | |
| for name in range(0,10): | |
| ClaimAsset(room=r,product_type_name=name,simple=False) | |
| session.commit() |
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
| Apparently, gist is a simple way to share snippets and pastes with others. All gists are Git repositories, so they are automatically versioned, forkable and usable from Git. |
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
| Output the symmetric difference of two sorted streams of numbers. | |
| Examples: | |
| list1 = [1,3,5,8] | |
| list2 = [2,5,6,7,8] | |
| output = [1,2,3,6,7] | |
| input1 = [1,2,3,4,99,100] | |
| input2 = [3,4,5,6,99] | |
| output = [1, 2, 5, 6, 100] |
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
| // http://user.qzone.qq.com/765591203 | |
| var pages = document.getElementById("tblog").contentWindow.document.getElementsByClassName("mod_pagenav_count")[0]; | |
| var posts = document.getElementById("tblog").contentWindow.document.getElementById("listArea").getElementsByTagName("li"); | |
| for (var i = 0; i < 1 /*posts.length*/; i++) { | |
| var postTitle = posts[i].getElementsByClassName("article")[0].textContent; | |
| var postLink = posts[i].getElementsByClassName("article")[0].getElementsByTagName("a")[0].href | |
| // http://user.qzone.qq.com/765591203/blog/1400775512 | |
| var entryDate = posts[i].getElementsByClassName("list_op")[0].childNodes[0].textContent; | |
| var readCount = posts[i].getElementsByClassName("list_op")[0].childNodes[2].textContent; |
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
| <!DOCTYPE html> | |
| <meta charset="utf-8" /> | |
| <title>WebSocket Test</title> | |
| <script language="javascript" type="text/javascript"> | |
| function submit() | |
| { | |
| wsUri = document.getElementById("wsUriInput").value; | |
| testWebSocket(); |
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
| // #bodyContent > div.mw-content-ltr > table:nth-child(21) > tbody > tr:nth-child(500) | |
| //*[@id="bodyContent"]/div[4]/table[10]/tbody/tr[500] | |
| // bgcolor="33CC33" | |
| c=document.getElementById("bodyContent") | |
| d=c.getElementsByClassName("mw-content-ltr")[0] | |
| e=d.getElementsByTagName("table") | |
| phoneTable=e[e.length - 4] | |
| phoneBuilds = [] |
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
| ## Jason Sun <jason@sunapi386.ca> | |
| ## Jan 30, 2017 | |
| ## | |
| ## Lists the duplicate files in the two given directories. | |
| ## Simple, only compares names. Case sensitive. | |
| ## Options: | |
| ## - filter by file extension | |
| ## - list the non-duplicate files | |
| ## - show the list (vs just stats) |
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
| bash-3.2$ find . \( -iname "*.h" -o -iname "*.c" \) -exec /bin/echo {} + | xargs awk -f lc.awk | |
| --------------------------------File---Code---Comments---Raw Lines | |
| -------------- ./include/kernel/scheduler.h 68 11 93 | |
| ./user/sensor.c 154 25 190 | |
| ./track/new/track_data_new.c 2352 1 2357 | |
| ./include/user/clock_drawer.h 4 0 6 | |
| ./include/utils.h 36 0 46 | |
| ./include/user/parser.h 5 0 6 |
OlderNewer