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
export default(tokens, screen_name, target, resolve)=> { | |
if ('function' === typeof target) { | |
resolve = target; | |
target = null; | |
}; | |
const client = new Twitter(tokens); | |
// … | |
} |
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
'use strict'; | |
/** | |
* Dependencies | |
*/ | |
var mock = require('superagent-mocker'); | |
var _ = require('lodash'); | |
/** | |
* Default fixtures |
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
sh_stats () { | |
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 | |
} |
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
{ | |
"env": { | |
"browser": true, | |
"node": true | |
}, | |
"parser": "babel-eslint", | |
"rules": { | |
"quotes": [2, "single"], | |
"strict": [2, "global"], | |
"no-unused-vars": false, |
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
const request = require('superagent'); // you know… | |
const mock = require('superagent-crud-mock'); // my awesome mock module | |
const topics = require('./topics'); // service provider, for example it's localstorage | |
mock(superagent) // patch `superagent` | |
.get('/topics/', (req, res) => { | |
res.json(topics.get()); // send json with data taken from the service | |
}) | |
.get('/topics/:id', (req, res) => { | |
res.json(topics.get(req.params.id)); |
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
'use strict'; | |
/** | |
* dependencies | |
*/ | |
import React from 'react'; | |
export default class Videolist extends React.Component { |
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
'use strict'; | |
// Dependencies | |
var textr = require('textr'); | |
var typograph = require('./typograph'); | |
/** | |
* append options on runtime | |
*/ | |
typograph("C'est la 'nature'?", { locale: 'ru' }); // C'est la «nature»? |
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 noop = function () { return function (text) { return text + text; }; } | |
var mws = [noop(), noop(), noop()]; | |
function forloop(text) { | |
var l = mws.length; | |
for (var i = 0; i < l; i++) { | |
text = mws[i].call(text, text) || text; | |
} | |
return text; | |
} |
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 tf = textr().use('trim'); | |
var tf = textr().use(String.prototype.trim); | |
var tf = textr().use(textr.native(String.prototype.trim)); |
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 React from 'react'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<h1>Hello, world.</h1> | |
); | |
} | |
} |