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 | |
# USE AT YOUR OWN RISK. Tested on Ubuntu 11.04 with apache2. | |
# CHECK COMMENTS BEFORE RUNNING | |
# this script creates localhost website folder and adds virtualhost | |
# website name - it will append .lh for the path | |
# ex.: 'example' will be accessed as example.lh in the browser | |
website="$@" | |
if [ -z "$website" ]; then | |
echo "No website, no fun." |
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
<script type="text/javascript"> | |
function fn(){ | |
//missing var declaration exposes 'x' to global scope | |
x = "surprise!" | |
//by using var 'y' remains private inside the instance of 'fn' | |
var y = "really private!" | |
} |
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(){$("#r_sidebar, #l_sidebar").remove(); $("#contentleft").css("width","960px") }); | |
})(jQuery) | |
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
/* Region related style for redirecting content flows */ | |
#article { | |
flow-into: article_flow; | |
} | |
#region1, #region2, #region3, #region4 { | |
flow-from: article_flow; | |
} | |
/* positioning and sizing of the region elements */ |
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
// idea from https://github.com/bartaz/impress.js | |
var arrayify = function ( a ) { | |
return Array.prototype.slice.call( 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
<!DOCTYPE HTML> | |
<html lang="ru-RU"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<script src="https://gist.github.com/1560618.js"> </script> | |
tsk | |
</body> |
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
class List < ActiveRecord::Base | |
has_many :related_lists, :finder_sql => 'SELECT * FROM related_lists WHERE list_a_id = #{id} OR list_b_id = #{id}' | |
end |
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{ | |
counter-reset: region-order; | |
} | |
[data-region]::before{ | |
display:block; | |
color:red; | |
content: counter(region-order); | |
counter-increment: region-order; | |
} |
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
// Free to use, reuse and abuse. | |
// Have fun! razvan.caliman@gmail.com | |
(function(){ | |
// Hack to make CSS Regions trigger click event handlers. | |
// Workaround for CSS Regions bug #76454 - https://bugs.webkit.org/show_bug.cgi?id=76454 | |
document.addEventListener("click", function(e){ | |
// get all the regions from the document based on a selector |
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
/* | |
Neat alternative to JavaScript templating by using an array. | |
Inspired by Ryan Florence | |
https://github.com/rpflorence/snack/blob/master/demos/jsonp/demo.js | |
*/ | |
var h = [], | |
p = function (){ h.push.apply(h, arguments) }, | |
data = ["one", "two", "three"] |