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
# Open the color picker | |
on convertRGBColorToHexValue(theRGBValues) | |
set theHexList to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"} | |
set theHexValue to "" | |
repeat with a from 1 to count of theRGBValues | |
set theCurrentRGBValue to (item a of theRGBValues) div 256 | |
if theCurrentRGBValue is 256 then set theCurrentRGBValue to 255 | |
set theFirstItem to item ((theCurrentRGBValue div 16) + 1) of theHexList | |
set theSecondItem to item (((theCurrentRGBValue / 16 mod 1) * 16) + 1) of theHexList | |
set theHexValue to (theHexValue & theFirstItem & theSecondItem) as 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
body { | |
background: linear-gradient(293deg, #aad8cb, #dc654d, #f7d66c, #372e36, #1a1919); | |
background-size: 1000% 1000%; | |
-webkit-animation: background 30s ease infinite; | |
-moz-animation: background 30s ease infinite; | |
-o-animation: background 30s ease infinite; | |
animation: background 30s ease infinite; | |
height: 1vh; | |
width: 1vw; | |
} |
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
// credit: Louis Lazaris | |
document.onreadystatechange = function () { | |
switch (document.readyState) { | |
case 'loading': | |
console.log('loading...'); | |
break; | |
case 'interactive': | |
console.log('DOM is ready...'); | |
break; | |
case 'complete': |
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
-- Returns the Levenshtein distance between the two given strings | |
-- Lower numbers are better | |
local function levenshtein(str1, str2) | |
local len1 = #str1 | |
local len2 = #str2 | |
local matrix = {} | |
local cost = 1 | |
local min = math.min; | |
-- quick cut-offs to save time |
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 | |
// specify your css-files and their order here | |
$cssFiles = array( | |
'normalize.css', 'style.css', 'print.css', 'colorbox.css' | |
); | |
// the file to write the compressed css to | |
$minFileName = 'minified.css'; | |
// thats all, just call this file in your browser and it will | |
// build you a minimized css-file. then just link to this single |
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 has3d(){ | |
var el = document.createElement('p'), | |
has3d, | |
transforms = { | |
'webkitTransform':'-webkit-transform', | |
'OTransform':'-o-transform', | |
'msTransform':'-ms-transform', | |
'MozTransform':'-moz-transform', | |
'transform':'transform' | |
}; |
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 node | |
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
/* | |
* lesswatch usage: | |
* | |
* `lesswatch` to watch the current directory |
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 https://github.com/james2doyle/saltjs | |
window.$ = function(s) { | |
try {return document[{ | |
'#': 'getElementById', | |
'.': 'getElementsByClassName', | |
'@': 'getElementsByName', | |
'=': 'getElementsByTagName', | |
'?': 'querySelectorAll' | |
}[s[0]]](s.slice(1));}catch(e){} | |
}; |
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 https://gist.github.com/Potfur/5576225 & https://github.com/james2doyle/saltjs | |
// more info: https://plus.google.com/109231487156400680487/posts/63eZzzrBSb6 | |
window.$ = function(s) { | |
var c = { | |
'#': 'ById', | |
'.': 'sByClassName', | |
'@': 'sByName', | |
'=': 'sByTagName'}[s[0]]; | |
return document[c?'getElement'+c:'querySelectorAll'](s.slice(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
(function() { | |
function async_load(){ | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
s.src = 'http://yourdomain.com/script.js'; | |
var x = document.getElementsByTagName('script')[0]; | |
x.parentNode.insertBefore(s, x); | |
} | |
if (window.attachEvent) { |
NewerOlder