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
/** | |
* Allows to use multiple refs on a single React element. | |
* Supports both functions and ref objects created using createRef() and useRef(). | |
* | |
* Usage: | |
* ```jsx | |
* <div ref={mergeRefs(ref1, ref2, ref3)} /> | |
* ``` | |
* | |
* @param {...Array<Function|Object>} inputRefs Array of refs |
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
/** | |
* Will gracefuly scroll the page | |
* This function will scroll the page using | |
* an `ease-in-out` effect. | |
* | |
* You can use it to scroll to a given element, as well. | |
* To do so, pass the element instead of a number as the position. | |
* Optionally, you can pass a `queryString` for an element selector. | |
* | |
* The default duration is half a second (500ms) |
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
import hashlib | |
import sys | |
try: | |
website_name = sys.argv[1] | |
hash_value = hashlib.md5(website_name) | |
print(hash_value.hexdigest().upper() + ".png") | |
except Exception, e: |
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
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin reset($type){ | |
$resets: ( | |
ul: ( | |
list-style: none, | |
margin: 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
var grunt = require('grunt'); | |
var hooker = require('hooker'); | |
module.exports = preAndPostHook = function () { | |
var currentTask = undefined; | |
/** | |
* Do something when the task has sta. | |
* @param taskName The task name. | |
*/ |
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
#!/usr/bin/env node | |
'use strict'; | |
var spawn = require('child_process').spawn; | |
var args = [ | |
'--harmony', | |
'app/bootstrap.js' | |
]; |
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
/** | |
* Make a X-Domain request to url and callback. | |
* | |
* @param url {String} | |
* @param method {String} HTTP verb ('GET', 'POST', 'DELETE', etc.) | |
* @param data {String} request body | |
* @param callback {Function} to callback on completion | |
* @param errback {Function} to callback on error | |
*/ | |
function xdr(url, method, data, callback, errback) { |