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
function fibonacci(num, memo) { | |
memo = memo || {}; | |
if (memo[num]) return memo[num]; | |
if (num <= 1) return 1; | |
return memo[num] = fibonacci(num - 1, memo) + fibonacci(num - 2, memo); | |
} |
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
### GIT | |
source ~/.bash/gitprompt.sh | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
alias gss="git status --short" | |
alias gl="git log --pretty=format:'%Cred%h%Creset - %C(green) %an %C(reset) - %C(yellow)%d%Creset %s %Cgreen(%cr) %Creset'" |
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
function fibonacci(num){ | |
var a = 1, b = 0, temp; | |
while (num >= 0){ | |
temp = a; | |
a = a + b; | |
b = temp; | |
num--; | |
} |
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
function fibonacci(num) { | |
if (num <= 1) return 1; | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
} |
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
runWhen([{ | |
changedFiles: () => Promise.resolve(['app/index.js', 'app/components/header.jsx']), | |
glob: ['app/components/**'], | |
task(paths) {} | |
}]) |
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 subprocess = exec(command, { | |
env: {...process.env, FORCE_COLOR: true} | |
}); |
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 subprocess = exec(command); | |
subprocess.stdout.pipe(process.stdout); | |
subprocess.stderr.pipe(process.stdout); | |
subprocess.on('exit', code => process.exit(code)); |
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
// Inline await to get the the user changed files | |
const filesToMatch = changedFiles ? await changedFiles() : files; | |
// Example of a test | |
test('should run command if glob files matches', async () => { | |
await modifyFixtures(); | |
const {stdout} = await run(`'["__fixtures__/**"]' 'echo fixtures changed'`); | |
expect(stdout.trim()).toEqual('fixtures changed'); | |
await restoreFixtures(); |
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
install: | |
- git clone https://github.com/$TRAVIS_REPO_SLUG.git $TRAVIS_REPO_SLUG | |
- cd $TRAVIS_REPO_SLUG | |
- git checkout -qf $TRAVIS_COMMIT |
NewerOlder