This is the haml version. If you want to use the same with erb just change haml to erb.
- Create you partial form example
_form.haml(The underscore at the beginning is really important). - In you
.hamlfile just write= partial("form").
| require 'rubygems' | |
| require 'sinatra' | |
| require 'redis' | |
| # To use, simply start your Redis server and boot this | |
| # example app with: | |
| # ruby example_note_keeping_app.rb | |
| # | |
| # Point your browser to http://localhost:4567 and enjoy! | |
| # |
| rack-contrib | |
| rack-rewrite |
| @implementation NSString (HexStuff) | |
| - (NSUInteger)hexValue | |
| { | |
| NSUInteger i = 0; | |
| // -- strip leading # | |
| if( [self hasPrefix:@"#"] ) | |
| i++; | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| struct xyz | |
| { | |
| float x, y, z; |
| #include <io.h> | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <windows.h> | |
| #include <Share.h> | |
| #include <math.h> |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
| // convert 0..255 R,G,B values to binary string | |
| RGBToBin = function(r,g,b){ | |
| var bin = r << 16 | g << 8 | b; | |
| return (function(h){ | |
| return new Array(25-h.length).join("0")+h | |
| })(bin.toString(2)) | |
| } | |
| // convert 0..255 R,G,B values to a hexidecimal color string | |
| RGBToHex = function(r,g,b){ |
| #!/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 | |
| # |
| // Usage: | |
| // var buf = new Uint8Array(128); | |
| // var bitstream = new BitStream(buf); | |
| // bitstream.writeBits(12, 0xffff); | |
| // bitstream.seekTo(0); | |
| // bitstream.readBits(6); // 111111 | |
| // bitstream.readBits(10); // 1111110000 | |
| window.BitStream = function(uint8Array) { |