Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
/* | |
== Tim == | |
A tiny, secure JavaScript micro-templating script. | |
This has now moved to: | |
github.com/premasagar/tim | |
*/ |
/* A lightweight templating system. | |
* | |
* Based on Tim (http://github.com/premasagar/tim) and Mustache | |
* (http://github.com/janl/mustache.js). | |
* | |
* Template supports simple value replacement as well as block | |
* functions, iterators and conditionals | |
* | |
* Template strings can contain either plain tokens `{{token}}` | |
* which are replaced with their equivilent value in the data |
{!-- build result rows --} | |
{exp:stash:set parse_tags="yes"} | |
{stash:results_rows} | |
{exp:channel:entries | |
channel="my_channel" | |
limit="10" | |
paginate="bottom" | |
} | |
<tr> |
var cat = {}; | |
/** | |
* cat.NewsBox | |
* Retrieves news from Google | |
*/ | |
cat.NewsBox = (function(){ | |
function NewsBox(searchTerm, injectFn) { | |
this.searchTerm = searchTerm; |
/* | |
NOTE!!!! | |
The most updated version of this code is here: | |
https://github.com/scottjehl/iOS-Orientationchange-Fix |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
if (typeof (AC) === "undefined") { | |
AC = {} | |
} | |
AC.ImageReplacer = Class.create({ | |
_defaultOptions: { | |
listenToSwapView: true, | |
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i, | |
filenameInsert: "_☃x", | |
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i, | |
attribute: "data-hires", |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
<script> | |
document.write('<script src=' + | |
('__proto__' in {} ? 'zepto' : 'jquery') + | |
'.js><\/script>') | |
</script> |
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).