Skip to content

Instantly share code, notes, and snippets.

@strongwave
strongwave / watchPosition_demo.html
Created October 19, 2011 00:33
A Demo Drawing Google Map using watchPosition API for HTML5
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
jQuery(window).ready(function(){
gMapInit();
jQuery("#watchPositionBtn").click(initiate_watchlocation);
jQuery("#stopWatchBtn").click(stop_watchlocation);
@strongwave
strongwave / getCurrentPosition_canvas.html
Created October 17, 2011 23:40
A Demo Drawing Google Map on Canvas Tag for HTML5
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
jQuery(window).ready(function(){
g_initialize();
jQuery("#findLocationBtn").click(initiate_geolocation);
});
@strongwave
strongwave / rvm_install_ruby.txt
Created October 6, 2011 21:25
command line to install ruby from rvm
$ sudo apt-get update
$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake
$ rvm install 1.9.2
@strongwave
strongwave / Modernizr_detect.txt
Created October 4, 2011 00:27
Features Modernizr supports
1. applicationCache
2. border-image:
3. border-radius:
4. box-shadow:
5. Canvas
6. Canvas Text
7. CSS 2D Transforms
8. CSS 3D Transforms
9. CSS Animations
10. CSS Columns
@strongwave
strongwave / git_reset.sh
Created September 30, 2011 05:03
Git command to get rid of all local modifications
git reset --hard HEAD
@strongwave
strongwave / ModernizerTest.js
Created September 30, 2011 00:18
Using Modernizer to Test Browser Html5 Support
/*
Author: Libo Cao Meyers
Date: 10/04/2011
Description: A javascript function that tests all modernizr supported html5/css3
features for current browser. Alert will tell user the supported
and non-supported feature for current browser. It contains a good
list of html5 tags as well.
*/
function testBrowserHtml5Support(){
@strongwave
strongwave / modernizr_include.html
Created September 29, 2011 23:38
Example of include modernizr in html5 page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dive Into HTML5</title>
<script src="modernizr.min.js"></script>
</head>
<body>
...
</body>
@strongwave
strongwave / html5_example_page.html
Created September 29, 2011 23:21
Example of a simple html5 page
<!DOCTYPE html>
<html id="home" lang="en">
<head>
<title>
HTML5 tutorial - 1
</title>
</head>
<body>
....
</body>
@strongwave
strongwave / httpd.conf
Created September 28, 2011 18:39
Edit /etc/httpd/conf/httpd.conf with passenger settings
LoadModule passenger_module /home/YOUR_USER_NAME/YOUR_APP_NAME/shared/bundle/ruby/1.9.1/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /home/YOUR_USER_NAME/YOUR_APP_NAME/shared/bundle/ruby/1.9.1/gems/passenger-3.0.7
PassengerRuby /usr/local/bin/ruby
@strongwave
strongwave / rerun_passenger-install-apache-module.sh
Created September 28, 2011 18:37
run passenger-install-apache2-module in correct gem path to generate new .so file for apache2
export GEM_HOME=/home/YOUR_USER_NAME/YOUR_APP_NAME/shared/bundle/ruby/1.9.1/
cd $GEM_HOME;
cd gems/passenger-3.0.7/bin
./passenger-install-apache2-module