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 baseDate = new Date(); | |
| function shiftDate(date, minutes){ | |
| date = new Date(date.valueOf() + minutes * 60 * 1000); | |
| if (date.getHours() > 22){ | |
| date.setHours(7); | |
| date.setDate(date.getDate() + 1); | |
| } | |
| return date; | |
| } |
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
| ~"cat".indexOf("r") // false |
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
| $ brew updae | |
| Already up-to-date | |
| $ brew install mongodb | |
| Error: mongodb-2.6.8 already installed | |
| To install this version, first `brew unlink mongodb` | |
| $ brew upgrade mongodb | |
| ==> Updating 1 outdated package, with result: | |
| mongodb 3.0.4 | |
| ... |
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
| process.env.NODE_ENV = process.env.NODE_ENV || 'development'; | |
| var logger = require("./server/components/logger"); | |
| /// | |
| // Set default node environment to development | |
| var express = require('express'); | |
| var mongoose = require('mongoose'); | |
| var config = require('./server/config/environment'); | |
| var fs = require('fs'), |
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
| /* | |
| * Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
| * Better handling of scripts without supplied ids. | |
| * | |
| * N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
| */ | |
| (function(doc, script) { | |
| var js, | |
| fjs = doc.getElementsByTagName(script)[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
| var textToPutOnClipboard = "This is some text"; | |
| document.addEventListener('copy', function(e) { | |
| e.clipboardData.setData('text/plain', textToPutOnClipboard); | |
| e.preventDefault(); | |
| }); | |
| $('#shortenerSubmitButton').on('mousedown',function(){ | |
| setTimeout(function(){ | |
| var host = new URL($('#shortenerInputText').val()).hostname; |
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
| css_css = Bundle( | |
| 'css/css.css', | |
| filters=['cssrewrite'], | |
| output='compiled_css.%(version)s{0}.css'.format(settings.GLOBAL_CACHE_LETTER)) | |
| register('css', css_css) |
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
| <input type="text" required pattern=".*\S+.*" /> |
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
| def fib(n): | |
| a, b = 0, 1 | |
| while a < n: | |
| print(a) | |
| a, b = b, a+b |
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 list = Array.apply(null, { length: 100 }).map(Number.call, Number).map(function (i) { | |
| return callback(i); | |
| }); |