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
/** | |
* This will normalize vertical centering of input text across browsers. | |
*/ | |
.mixin-input-height (@font-size, @height-scale: 2.5) { | |
@input-height: @font-size * @height-scale; | |
@input-padding-vertical: (@input-height - @font-size) / 2; | |
font-size: @font-size; | |
height: @input-height + 2; // webkit seems to have a weird 1px gap | |
// to vertically center input text in IE <= 8, but not stretch caret in modern browsers |
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
module.exports = function () { | |
// If there is an uncaught exception anywhre in your app, it will result in a proper 500 page. | |
if (Math.random() < 0.3) throw new Error("Oops, my random is low"); | |
// They don't have to happen in the first tick either | |
if (Math.random() < 0.2) return setTimeout(function () { | |
throw new Error("Delayed random bites"); | |
}); | |
// If you throw an object, it will send a JSON document to the client | |
if (Math.random() > 0.6) throw {Hello: request.url}; |
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
Blog post on jekyll and gh-pages functionality | |
http://haacked.com/archive/2013/12/02/dr-jekyll-and-mr-haack/ | |
Balrog | |
Node based static site generator | |
https://github.com/jlord/balrog | |
Example >> https://github.com/jlord/jlord.github.io | |
GitPress (Python / Node backend) | |
https://github.com/joeyespo/gitpress |
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
*.cs diff=csharp |
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
// ==UserScript== | |
// @name SelfUpdatingScript | |
// @version 1.0.0 | |
// @namespace Benjol (http://stackoverflow.com/users/11410/benjol) | |
// @description Template script for a self-updating script | |
// @credits Kudos to http://stackoverflow.com/users/115866/balpha | |
// @include https://gist.github.com/* | |
// ==/UserScript== | |
function with_jquery(f) { |
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 randomChoice(arr) { | |
return arr[Math.floor(Math.random() * arr.length)]; | |
} | |
function randint(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
function drawCircleANotFilled(ctx, x, y, radius, width, color) { | |
ctx.beginPath(); |
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
/*! | |
* $imple cache - v0.3pre - 07/15/2010 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function($,window){ |