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
| buildQuery: function() { | |
| var query = []; | |
| var name = this.username.value; | |
| var startDate = this.startDate.value; | |
| var endDate = this.endDate.value; | |
| if(name) { | |
| query.push("username LIKE '%"+name+"%'"); | |
| } |
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
| HOSTS_FILE="/etc/hosts" | |
| PRISTENE_HOSTS="$HOME/hosts-clean" | |
| TEST_ENV_HOSTS="$HOME/hosts-test" | |
| function switchhosts { | |
| if [ $1 = "prod" ] | |
| then | |
| sudo cp "$PRISTENE_HOSTS" "$HOSTS_FILE" | |
| fi |
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
| fancy-ctrl-z () { | |
| if [[ $#BUFFER -eq 0 ]]; then | |
| fg | |
| zle redisplay | |
| else | |
| zle push-input | |
| zle clear-screen | |
| fi | |
| } | |
| zle -N fancy-ctrl-z |
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
| .post.grid .description { | |
| margin-top: 15px; | |
| font-weight: 400; | |
| font-size: 14px; | |
| line-height: 19px; | |
| overflow: hidden; | |
| position: relative; | |
| max-height: 57px; | |
| } | |
| .post.grid .description:after { |
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
| for (var i = 1; i <= 100; i++) { | |
| var x = ''; | |
| if(i%3===0) x += 'Fizz'; | |
| if(i%5===0) x += 'Buzz'; | |
| console.log(x=='' ? i : x); | |
| } |
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
| var data = [['B1','B2','B3'],[1,2,3],[4,5,6],[7,8,9]]; | |
| // this would normally be provided by some sort of functional lib (or in a real functional language) | |
| function zipObject(keys, vals) { | |
| var zip = {}; | |
| keys.forEach(function(k,i) {zip[k] = vals[i];}); | |
| return zip; | |
| } | |
| function generateWantedData(columnNames, ...data) { |
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
| var data = [['B1','B2','B3'],[1,2,3],[4,5,6],[7,8,9]]; | |
| // this would normally be provided by some sort of functional lib (or in a real functional language) | |
| function zipObject(keys, vals) { | |
| var zip = {}; | |
| keys.forEach(function(k,i) {zip[k] = vals[i];}); | |
| return zip; | |
| } | |
| function car(arr) { |
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
| 'use strict'; | |
| global.nodeMocha = true; | |
| var chai = require('chai'); | |
| var sinon = require('sinon'); | |
| var sinonChai = require('sinon-chai'); | |
| var chaiJq = require('chai-jq'); | |
| chai.use(sinonChai); |
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
| // Add promise support for browser not supporting it | |
| import es6Promise from 'es6-promise'; | |
| es6Promise.polyfill(); | |
| import fetch from 'isomorphic-fetch'; | |
| // or use axios | |
| import axios from 'axios'; |
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
| var critical = /(?!\.critical).*\.less$/; | |
| // matches | |
| Title.critical.less | |
| // but not | |
| Toast.less | |
| App.less | |
| var nonCritical = /^((?!critical).)*\.less$/gm; |
OlderNewer