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
| # Description: | |
| # Get a random quote from The Big Lebowski. | |
| # | |
| # Dependencies: | |
| # "htmlparser": "1.7.6" | |
| # "soupselect": "0.2.0" | |
| # "underscore": "1.3.3" | |
| # "underscore.string": "2.3.0" | |
| _ = require("underscore") |
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
| <script src="main.js"></script> |
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
| module.exports = { | |
| entry: './main.js', | |
| output: { | |
| filename: 'build.js' | |
| }, | |
| resolve: { | |
| alias: { | |
| react: 'react/addons' | |
| } | |
| } |
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 rename(obj, keymap) { | |
| var ret = {}; | |
| for (var key in obj) { | |
| if (key in keymap) { | |
| ret[keymap[key]] = obj[key]; | |
| } else { | |
| ret[key] = obj[key]; | |
| } | |
| } | |
| return ret; |
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
| isNaN({}); // true | |
| isNaN('str'); // true | |
| isNaN(NaN); // true | |
| isNaN('1'); // false | |
| isNaN('NaN'); // true | |
| isNaN([]); // false | |
| isNaN({} + {}); // true | |
| NaN != NaN; // 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
| export default function add(...args){ | |
| return args.reduce( (a,b) => a + b, 0 ) | |
| } |
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
| ❯ node test.js | |
| MyMixin.componentWillMount | |
| MyComponentWithMyMixin.componentWillMount | |
| <div data-reactid=".1mp0vtdeha8" data-react-checksum="1376071101"><span data-reactid=".1mp0vtdeha8.0">Hello </span><span data-reactid=".1mp0vtdeha8.1">World</span></div> |
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(){ | |
| var differences = {}, | |
| exceptions, | |
| globals = {}, | |
| ignoreList = (prompt('Ignore filter (comma sep)?', '') || '').split(','), | |
| i = ignoreList.length, | |
| iframe = document.createElement('iframe'); | |
| while (i--) { | |
| globals[ignoreList[i]] = 1 | |
| } |
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
| package main | |
| import ( | |
| "net/http" | |
| "fmt" | |
| "log" | |
| ) | |
| func main() { | |
| http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request){ |
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
| RE_ESCAPE_LUCENE = / | |
| ( [-+!\(\)\{\}\[\]^"~*?:\\\/] # A special character | |
| | && # Boolean && | |
| | \|\| # Boolean || | |
| ) | |
| /x | |
| "123-456-7890".gsub(RE_ESCAPE_LUCENE) { |m| "\\#{m}" } |