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
test |
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
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */ | |
/* Default font size in pixels if not overridden. */ | |
$baseFontSize: 16; | |
/* Convert PX units to EMs. | |
Ex: margin-right: pem(16); | |
*/ | |
@function pem($pxval, $base: $baseFontSize) { | |
@return #{$pxval / $base}em; |
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: | |
JavaScript.load("/javascripts/something.js"); | |
// With callback (that’s the good thing): | |
JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
API.use(); // or whatever api.js provides ... | |
}); |
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 python | |
from pypodio2 import api | |
import sys, shutil, os, json | |
c = api.OAuthClient(sys.argv[1],sys.argv[2], sys.argv[3], sys.argv[4]) | |
orginfo = c.transport.get(url = '/org/') | |
def writerawtext(filename, data): | |
try: |
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
/* | |
https://gist.github.com/jeffdrumgod/5788907 | |
http://stackoverflow.com/a/2866613 | |
decimal_sep: character used as deciaml separtor, it defaults to '.' when omitted | |
thousands_sep: char used as thousands separator, it defaults to ',' when omitted | |
*/ | |
Number.prototype.toMoney = function(decimals, decimal_sep, thousands_sep) | |
{ | |
var n = this, |
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
/*! Copyright 2011, Ben Lin (http://dreamerslab.com/) | |
* Licensed under the MIT License (LICENSE.txt). | |
* | |
* Version: 1.0.2 | |
* | |
* Requires: jQuery 1.2.3+ | |
*/ | |
$.preload = function(){ | |
var tmp = [], i = arguments.length; | |
// reverse loop run faster |
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
if("function"!=typeof(String.prototype.replaceSpecialChars)) String.prototype.replaceSpecialChars=function(){var _replace={"ç":"c","æ":"ae","œ":"oe","á":"a","é":"e","í":"i","ó":"o","ú":"u","à":"a","è":"e","ì":"i","ò":"o","ù":"u","ä":"a","ë":"e","ï":"i","ö":"o","ü":"u","ÿ":"y","â":"a","ê":"e","î":"i","ô":"o","û":"u","å":"a","ã":"a","ø":"o","õ":"o","u":"u","Á":"A","É":"E","Í":"I","Ó":"O","Ú":"U","Ê":"E","Ô":"O","Ü":"U","Ã":"A","Õ":"O","À":"A","Ç":"C"};return this.replace(/[à-ú]/g,function(a){if(typeof(_replace[a])!="undefined") return _replace[a]; return a;});}; |
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 truncate_words($text, $limit, $ellipsis = '...') { | |
$words = preg_split("/[\n\r\t ]+/", $text, $limit + 1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_OFFSET_CAPTURE); | |
if (count($words) > $limit) { | |
end($words); //ignore last element since it contains the rest of the string | |
$last_word = prev($words); | |
$text = substr($text, 0, $last_word[1] + strlen($last_word[0])) . $ellipsis; | |
} | |
return $text; | |
} |
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
/* https://gist.github.com/jeffdrumgod/5997078 | |
* querySelectorObj | |
* | |
* Return object with parameters. | |
* Return null if result or query is empty. | |
* | |
* var query = only query, not full url | |
* var key = looking for that key and returns its value if it finds | |
* var value = Search this value and returns the key, if it finds |
OlderNewer