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 memoize(fn) { | |
| var cache = {}; | |
| // return a memoized version of the function | |
| return function(arg) { | |
| // intercept the argument | |
| if ( !(arg in cache) ) { | |
| // if it's not in cache, execute the original function and | |
| // cache the result, using the argument as the cache key. | |
| cache[arg] = fn.call(this, arg); |
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
| const gulp = require('gulp'); | |
| const shelter = require('gulp-shelter')(gulp); | |
| const BRANCH = process.env.TRAVIS_BRANCH; | |
| // project config | |
| const project = 'projectName'; | |
| const main = `src/main.js`; | |
| const dest = `dist/${project}.js`; | |
| const domain = ( | |
| BRANCH === 'master' ? 'www.domain.com' : |
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
| "name": "fooproject", | |
| "config": { | |
| "reporter": "xunit" | |
| }, | |
| "scripts": { | |
| "test": "mocha test/ --reporter $npm_package_config_reporter", | |
| "test:dev": "npm run test --fooproject:reporter=spec" | |
| } |
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
| "devDependencies": { | |
| "eslint": "latest", | |
| "node-sass": "latest", | |
| "browserify": "latest" | |
| }, | |
| "scripts": { | |
| "lint": "eslint **", | |
| "build:css": "node-sass src/ -o dist/", | |
| "build:js": "browserify src/main.js > dist/main.js", | |
| "build": "npm run lint && npm run build:css && npm run build:js" |
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
| // through2 is a thin wrapper around node transform streams | |
| var through = require('through2'), | |
| gutil = require('gulp-util'), | |
| esprima = require('esprima'), | |
| escodegen = require('escodegen'), | |
| estraverse = require('estraverse'), | |
| _ = require('lodash'), | |
| PluginError = gutil.PluginError; | |
| // consts |
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
| textarea { | |
| width: 100%; | |
| height: 300px; | |
| margin: 0; | |
| padding: 20px; | |
| border: 0; | |
| border-radius: 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
| <!DOCTYPE html> | |
| <html> | |
| <!-- | |
| <== The code that creates the glyph is in script.js | |
| --> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css" rel="stylesheet" /> |
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
| textarea { | |
| width: 100%; | |
| height: 300px; | |
| margin: 0; | |
| padding: 20px; | |
| border: 0; | |
| border-radius: 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
| # D'après ce tutoriel : http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ | |
| $ xcode-select --install | |
| $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| $ brew install git | |
| $ brew doctor | |
| $ brew install node |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.