This file contains 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
Gem::Specification.new do |spec| | |
spec.name = 'sass-yuv' | |
spec.version = '0.1.0' | |
spec.platform = Gem::Platform::RUBY | |
spec.author = 'Tobias H. Michaelsen' | |
spec.email = '[email protected]' | |
spec.summary = 'YUV color space in SASS' | |
spec.description = 'A simple extension to SASS that alows you to convert to and from the YUV color space, and adjust brightness.' | |
spec.homepage = 'https://gist.github.com/1694554' | |
spec.license = 'MIT' |
This file contains 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 contrast = (function () { | |
var MIN_CONTRAST_RATE_AA = { normal: 4.5, large: 3 }, | |
MIN_CONTRAST_RATE_AAA = { normal: 7, large: 4.5 }, | |
MIN_BRIGHT_DIFF = 125/255, | |
MIN_COLOR_DIFF = 500/255, | |
BRIGHTNESS_COEFS = [0.299, 0.587, 0.114], | |
LUMINANCE_COEFS = [0.2126, 0.7152, 0.0722]; | |
function abs_diff(array, other) { |
This file contains 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
# encoding: UTF-8 | |
require 'erb' | |
puts __ENCODING__ | |
puts ERB.new('<%= __ENCODING__ %>').result |
This file contains 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
-- initial | |
UPDATE item SET depth = 0 WHERE parent_item_guid IS NULL; | |
-- SQLite3 doesn't support loops, so run this until `select count(*) from item where product_code is null` = 0 | |
INSERT OR REPLACE INTO item(item_guid, user_guid, parent_item_guid, name, depth) | |
SELECT t.item_guid, t.user_guid, t.parent_item_guid, t.name, p.depth + 1 FROM item AS t | |
INNER JOIN item AS p ON (t.parent_item_guid = p.item_guid) | |
WHERE p.depth >= 0 | |
AND NOT p.item_guid IS NULL | |
AND t.depth IS NULL; |
This file contains 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
javascript:(function(){var i=document.querySelector('#comic img'),t=i.getAttribute('title');i.insertAdjacentText('afterEnd',t);})(); |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>beforeRunningCommand</key> | |
<string>nop</string> | |
<key>command</key> | |
<string>`which node` "$TM_FILEPATH"</string> | |
<key>input</key> | |
<string>none</string> |
This file contains 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
24c24 | |
< ResourceFile := "AutoHotkeySC.bin" ; you many comment out one of | |
--- | |
> ;ResourceFile := "AutoHotkeySC.bin" ; you many comment out one of | |
71a72 | |
> { | |
72a74,75 | |
> GoSub,RT_ICON ; 2011-02-03/THM: Add another copy of the same icon to work around a bug in Stack Docklet 2.0 | |
> } |
This file contains 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 foo() { return 'foo'; } | |
function bar() { return foo; } | |
foo() | |
//=> "foo" | |
bar() | |
//=> function foo() { return 'foo'; } | |
new foo() | |
//=> [Object foo] | |
new bar() | |
//=> function foo() { return 'foo'; } |
This file contains 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
// Source: http://www.pluralsight-training.net/community/blogs/keith/archive/2010/11/12/min-max-between-limit.aspx | |
public static class IComparableExtensions | |
{ | |
public static T Limit<T>(this T value, T minValue, T maxValue) where T : IComparable | |
{ | |
if (value.CompareTo(minValue) < 0) | |
return minValue; | |
if (value.CompareTo(maxValue) > 0) | |
return maxValue; | |
return value; |
This file contains 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
try { | |
print(fn1); | |
print(fn2); | |
function fn1 () {} // FunctionDeclarations | |
(function fn2 () {}) // FunctionExpression | |
} catch (e) { |