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").
| javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('%23header,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push,%20.wiki-actions,%20%23last-edit,%20.actions,%20.header').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D);%20$('link').removeAttr('media');%7D); |
| # | |
| # blob : Object from MongoDB | |
| # | |
| # blob.body: Buffer | |
| # blob.size: length of buffer, substitute for blob.body.length | |
| # blob.type: MIME (Eg. audio/x-wav) | |
| # | |
| # req : Object from http | |
| # res : Object from http | |
| # _ : Object from underscore |
| // 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) { |
| #!/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 | |
| # |
| // 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){ |
| /* | |
| * 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'; |
| #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> |
| #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; |
| @implementation NSString (HexStuff) | |
| - (NSUInteger)hexValue | |
| { | |
| NSUInteger i = 0; | |
| // -- strip leading # | |
| if( [self hasPrefix:@"#"] ) | |
| i++; | |