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
countryHash: { | |
unicodeCountry: { | |
AF: "Afghanistan", | |
AX: "Aland Islands", | |
AL: "Albania", | |
DZ: "Algeria", | |
AS: "American Samoa", | |
AD: "Andorra", | |
AO: "Angola", | |
AI: "Anguilla", |
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 getCachedJSON = function (url) { | |
var deferred = new $.Deferred(); | |
var cachedData = window.localStorage[url]; | |
if (cachedData) { | |
log('Data already cached, returning from cache:', url); | |
deferred.resolve(JSON.parse(cachedData)); | |
} else { | |
$.getJSON(url, function(data) { | |
log('Fetched data, saving to cache:', url); | |
window.localStorage[url] = JSON.stringify(data); |
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
#!/bin/sh | |
# Pre-commit file needs to be executable so first | |
# chmod +x .git/hooks/pre-commit | |
# Fix your grunt path | |
PATH="/usr/local/bin:$PATH" | |
# Runs grunt default | |
echo "Running Grunt..." |
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
<html> | |
<head> | |
<title>Dithering Test</title> | |
</head> | |
<body> | |
<canvas></canvas> | |
<script> | |
var canvas = document.getElementsByTagName("canvas")[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
@mixin smart-underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){ | |
a { | |
color: inherit; | |
text-decoration: none; | |
background: -webkit-linear-gradient($background, $background), -webkit-linear-gradient($background, $background), -webkit-linear-gradient($text, $text); | |
background-size: .05em 1px, .05em 1px, 1px 1px; | |
background-repeat: no-repeat, no-repeat, repeat-x; | |
text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background; | |
background-position-y: $position,$position, $position; | |
background-position-x: 0%, 100%, 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() { | |
'use strict'; | |
angular.module('webApp.filters') | |
.filter('widowFix', function() { | |
return function(input) { | |
if (input !== undefined) { | |
var wrapper= document.createElement('div'); |
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
html, | |
body, | |
#doc { | |
height: 100%; // Passes through the height of the parent iframe element | |
} | |
#doc { | |
// Magic to prevent iOS growing the iFrame to fit the content. | |
// This container will mimic the behavior of the iframe on a desktop browser | |
-webkit-overflow-scrolling:touch; | |
overflow-y: scroll; |
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
diff -qr dirA dirB | sort > diffs.txt |
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
#Fix a folder made as root | |
sudo chown -R $(whoami) . | |
#List files in single column | |
ls -R -1 . |
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
Date.prototype.stdTimezoneOffset = function() { | |
var jan = new Date(this.getFullYear(), 0, 1); | |
var jul = new Date(this.getFullYear(), 6, 1); | |
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); | |
} | |
Date.prototype.dst = function() { | |
return this.getTimezoneOffset() < this.stdTimezoneOffset(); | |
} |
OlderNewer