most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| Number::pad = (digits, signed) -> | |
| s = Math.abs(@).toString() | |
| s = "0" + s while s.length < digits | |
| (if @ < 0 then "-" else (if signed then "+" else "")) + s | |
| Date.months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] | |
| Date.weekdays = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] | |
| Date.formats = | |
| "a": -> Date.weekdays[@getDay()].substring(0, 3) |
| <?php | |
| /* | |
| * dl-file.php | |
| * | |
| * Protect uploaded files with login. | |
| * | |
| * @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
| * | |
| * @author hakre <http://hakre.wordpress.com/> | |
| * @license GPL-3.0+ |
| var map = new L.Map('map'); | |
| var mapquestUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', | |
| subDomains = ['otile1','otile2','otile3','otile4'], | |
| mapquestAttrib = 'Data, imagery and map information provided by <a href="http://open.mapquest.co.uk" target="_blank">MapQuest</a>, | |
| <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> and contributors. | |
| var mapquest = new L.TileLayer(mapquestUrl, {maxZoom: 18, attribution: mapquestAttrib, subdomains: subDomains}); |
| # ~/.gitconfig from @boblet | |
| # initially based on http://rails.wincent.com/wiki/Git_quickstart | |
| [core] | |
| excludesfile = /Users/oli/.gitignore | |
| legacyheaders = false # >git 1.5 | |
| quotepath = false | |
| # http://stackoverflow.com/questions/136178/git-diff-handling-long-lines | |
| pager = less -r | |
| # if ↑ doesn’t work, try: pager = less -+$LESS -FRX |
| (function (exports) { | |
| "use strict"; | |
| exports.Foo = 'Bar'; | |
| }('undefined' !== typeof exports && exports || new Function('return this')())); | |
| // Note: A common mistake in this pattern is to assume that `this` is the global `window`, | |
| // but even when running in a non-strict context `this` will not be `window` when using a |
| // This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.github.io | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
| */ |
| .leaflet-div-icon { | |
| background: transparent; | |
| border: none; | |
| } | |
| .leaflet-marker-icon .number{ | |
| position: relative; | |
| top: -37px; | |
| font-size: 12px; | |
| width: 25px; |
Inspired by this article. Neat tricks for speeding up integer computations.
Note: cin.sync_with_stdio(false); disables synchronous IO and gives you a performance boost.
If used, you should only use cin for reading input
(don't use both cin and scanf when sync is disabled, for example)
or you will get unexpected results.
x = x << 1; // x = x * 2
| # Variables | |
| exp = require 'express' | |
| app = exp.createServer() | |
| pass = require 'passport' | |
| BrowserID = require('passport-browserid').Strategy | |
| # Passport Serialize and Deserialize Functions | |
| pass.serializeUser (user, done) -> | |
| done null, user.email |