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
''' | |
based on: http://24ways.org/2010/calculating-color-contrast/ | |
accepts hex colors with 3 or 6 chars. hash-char is optional. | |
''' | |
def get_contrast_yiq(hex_color): | |
hex_color = hex_color.replace("#", "") | |
if len(hex_color) == 3: | |
hex_color = "".join([c + c for c in hex_color]) |
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
for (var i = 0, max = json.length; i < max; i++) { | |
selectElm.innerHTML += "<option value='" +json["id"] + "'>" + json["foretag"] + "</option>"; | |
} |
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
.line { | |
overflow: hidden; | |
} | |
.unit { | |
float: left; | |
box-sizing: border-box; | |
} | |
.size1of1 { float: none; } |
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
# set --cut-dir to the no parents that should be omitted (in this case 2: a and b) | |
wget -nv -r -nH --cut-dirs=2 ftp://<username>:<passwd>@<server>/a/b/ |
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
<?php | |
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?="; | |
// mail( ... ) |
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
# example use: | |
# rake favicons["../img/origin.png"] | |
# | |
# Output: | |
# ./apple-touch-icon-114x114-precomposed.png | |
# ./apple-touch-icon-114x114.png | |
# ./apple-touch-icon-57x57-precomposed.png | |
# ./apple-touch-icon-57x57.png | |
# ./apple-touch-icon-72x72-precomposed.png | |
# ./apple-touch-icon-72x72.png |
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
/* @group valignfix */ | |
/* *************************************** | |
valignfix, by Anders Ytterström @ madr.se | |
**************************************** */ | |
/* | |
HTML fixture: | |
.valign | |
%div | |
%div | |
%h1 |
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
#!/usr/bin/env ruby | |
require 'net/https' | |
require "rexml/document" | |
require "date" | |
require 'net/smtp' | |
# delicious | |
@username = "YOU" | |
@password = "secr3t" |
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
#!/usr/bin/env ruby | |
require 'net/https' | |
require "rexml/document" | |
require "date" | |
require 'net/smtp' | |
# delicious | |
@username = "YOU" | |
@password = "secr3t" |
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 BPs = {}; | |
var AnobiiBadge = (function(){ | |
var BADGE_URL = 'http://widgets.anobii.com/badge_result?settingId=4dd4b3916a743731'; | |
var bodyElm = document.getElementsByTagName('body')[0]; | |
return { | |
init: function(){ | |
var script = document.createElement('script'); | |
script.src = BADGE_URL; | |
script.type = 'text/javascript'; | |
bodyElm.appendChild(script); |