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
| #user nobody; | |
| worker_processes 1; | |
| #error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; | |
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 R = require('ramda') | |
| var arr = [{id:'123123123',name:'smthelse'}, {id:'123123123 2',name:'smthelse 2'}]; | |
| var recomposeKeys = function(newNames,oldNames){ | |
| return function(d){ | |
| return R.zipObj(newNames, R.props(oldNames)(d)) | |
| } | |
| } | |
| R.map(recomposeKeys(['text','value'], ['id','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
| var MiddleWare = function(cb, cont){ | |
| var calb = cb; | |
| return function(err,res){ | |
| var result = JSON.parse(res.text); | |
| if(err||result.redirect) { | |
| if(cont) | |
| { | |
| cont.flux.actions.login.signout(); | |
| } |
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
| .datepicker-dates { | |
| position: relative; | |
| width: 156px; | |
| height: 100%; | |
| margin-top: 0.5em; | |
| } | |
| .datepicker { | |
| position:relative; |
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 to package.json | |
| { | |
| "preferGlobal": "true", | |
| "bin": { | |
| "server" : "./index.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
| { | |
| "remove-empty-rulesets": true, | |
| "always-semicolon": true, | |
| "color-case": "lower", | |
| "block-indent": " ", | |
| "color-shorthand": true, | |
| "element-case": "lower", | |
| "eof-newline": true, | |
| "leading-zero": false, | |
| "quotes": "single", |
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> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Building a router</title> | |
| <script> | |
| // Put John's template engine code here... | |
| (function () { | |
| // A hash to store our routes: |
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
| $no: 0 | |
| $x: 3px | |
| $s: 5px | |
| $m: 10px | |
| $l: 20px | |
| $xl: 25px | |
| $type: p m | |
| $typen: padding margin | |
| $dir: t b l r a h v | |
| $dirname: -top -bottom -left -right '' '' '' |
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 stripUrlParams(url, paramsToStrip){ | |
| var queryArrs = url.split('?'); | |
| if(queryArrs.length===1||queryArrs[1]==="") { | |
| return url.replace(/(.+)(\?)$/, '$1');; | |
| } | |
| var params = queryArrs[1].split('&'); | |
| var ob = {}; | |
| params = params.reverse(); | |
| for(el in params) { | |
| var val=params[el].split("="); |
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 formatWords(words){ | |
| if (!words) return ""; | |
| return words.filter(function(a) { return a !== ''}).join(', ').replace(/(, )+(\S+)$/, ' and $2'); | |
| } |