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 xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title> CSS Border Radius madness </title> | |
<style> | |
.round { | |
margin: 100px; | |
width: 250px; | |
height: 100px; |
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
http://www.html5rocks.com | |
http://slides.html5rocks.com | |
http://html5doctor.com | |
http://caniuse.com | |
http://html5reset.org | |
http://html5boilerplate.com | |
http://diveintohtml5.org | |
http://code.google.com/chrome/chromeframe/ |
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
// rails needs the authenticy_token param in non-idempotent request to protect from CSRF | |
var | |
// authenticity token name | |
AUTH_TOKEN_NAME = $( 'meta[name=csrf-param]' ).attr( 'content' ), | |
// authenticity token value | |
AUTH_TOKEN_VALUE = $( 'meta[name=csrf-token]' ).attr( 'content' ); | |
// for each and every Ajax post request automatically append the 'authenticity_token' param | |
$( document ).ajaxSend( function ( event, xhr, settings ) { | |
// rails does not need the authenticity_token for GET requests |
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
~$ mkdir your_repo_name | |
~$ cd your_repo_name | |
~$ git init | |
~$ git remote add origin git@YOUR_SERVER_HOSTNAME:your_repo_name.git | |
# do some work, git add and commit files | |
~$ git add . | |
~$ git commit -m 'Your Message' | |
# push the new repo to central repository ( gitosis ) |
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
// A Simple URL Parser, works in Browser only AFAIK, Please test before you use :-) | |
var Uri = ( function () { | |
var keys = ['host', 'hostname', 'protocol', 'pathname', 'search', 'hash', 'port']; | |
return { | |
// Method parses URI string and returns an object with parts name e.g. host, protocol | |
// @param {String} uri | |
parse: function ( uri ) { |
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
# coding: utf-8 | |
# | |
# Encode any codepoint outside the ASCII printable range to an HTML character | |
# reference (http://bit.ly/KNupLT). | |
def encode(string) | |
string.each_codepoint.inject("") do |buffer, cp| | |
cp = "&#x#{cp.to_s(16)};" unless cp >= 0x20 && cp <= 0x7E | |
buffer << cp | |
end | |
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
# Usage: redis-cli publish message.achannel hello | |
require 'sinatra' | |
require 'redis' | |
conns = Hash.new {|h, k| h[k] = [] } | |
Thread.abort_on_exception = true | |
get '/' do |
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 CompressedRequests | |
def initialize(app) | |
@app = app | |
end | |
def method_handled?(env) | |
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/) | |
end | |
def encoding_handled?(env) |
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
=begin | |
Capistrano deployment email notifier for Rails 3 | |
Do you need to send email notifications after application deployments? | |
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html. | |
Here is Rails 3 port of the notifier. | |
The notifier sends an email after application deployment has been completed. |
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
=begin | |
Capistrano deployment email notifier for Rails 3 | |
Do you need to send email notifications after application deployments? | |
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html. | |
Here is Rails 3 port of the notifier. | |
The notifier sends an email after application deployment has been completed. |
OlderNewer