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
| function dataURIToBlob(dataURI) { | |
| var parts = dataURI.split(','); | |
| var binary = atob(parts[1]); | |
| var type = parts[0]; | |
| var array = []; | |
| for(var i = 0; i < binary.length; i++) { | |
| array.push(binary.charCodeAt(i)); | |
| } | |
| return new Blob([new Uint8Array(array).buffer], {type: type}); | |
| } |
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
| let win = require("window-utils").windowIterator().next(); | |
| let {Cc, Ci} = require("chrome"); | |
| let window = win.QueryInterface(Ci.nsIDOMWindowInternal); | |
| //window.atob, window.FormData, etc etc... |
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
| // board.js | |
| var roll, win_game, say, score, board, move, yeild; | |
| var players = [{position:0, name: 'Jeff', points:0}, {position:0, name: 'Nathan', points: 0}]; | |
| //var players = [{position:0, name: 'bill'}]; | |
| var win = false; | |
| // functions here take an argument and return how many places to move | |
| roll = function() { | |
| var dice = Math.floor((Math.random() * 6) + 1); | |
| return dice; |
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 with grunt-exec command: 'open -a "/Applications/Google Chrome.app" file://localhost/reload' | |
| */ | |
| chrome.webRequest.onBeforeRequest.addListener(hook, {urls: ['file://localhost/reload*']}); | |
| function hook(details) { | |
| console.log('reloading all dev extensions'); | |
| chrome.management.getAll(function(extensions){ | |
| for(var i in extensions){ | |
| extension = extensions[i]; |
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
| -Go to the starting point of the project | |
| >> git checkout origin master | |
| -Create and checkout your branch | |
| >> git checkout -b [branch] | |
| -Make changes | |
| >> git commit -a -m"commit messages" | |
| -Push the changes to the remote if you want review, so on | |
| >> git push origin [branch] | |
| -Go back to the branch you want to merge to | |
| >> git checkout master |
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
| //Derived from http://people.mozilla.org/~dietrich/ubiquity.js | |
| var sources = ["history", "bookmarks", "starred", "tagged", "session"]; | |
| var sorts = ["freshness", "age", "frequency", "infrequency", "recency", "staleness"] | |
| var noun_type_places_datasource = new CmdUtils.NounType("datasource", sources); | |
| var noun_type_places_sorts = new CmdUtils.NounType(" sort attribute", sorts); | |
| var debugMode = true; | |
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
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <stdlib.h> | |
| #include <stdarg.h> | |
| #include <string.h> | |
| #define NOINLINE __attribute__((noinline)) | |
| const size_t CONTINUATION_STACK_SIZE = 8192; |
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
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <stdlib.h> | |
| #include <stdarg.h> | |
| #define NOINLINE __attribute__((noinline)) | |
| typedef unsigned char byte; | |
| typedef struct Continuation { |
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
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <stdlib.h> | |
| #include <stdarg.h> | |
| #include <string.h> | |
| #define NOINLINE __attribute__((noinline)) | |
| const size_t CONTINUATION_STACK_SIZE = 8192; |
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
| from scrapy import log | |
| from scrapy.contrib.spiders import CrawlSpider, Rule | |
| from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
| from scrapy.xpath.selector import HtmlXPathSelector | |
| from scrapy.item import ScrapedItem | |
| def safecn(i): | |
| try: | |
| return unichr(int(i)) | |
| except: |