This file contains hidden or 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
| # ruby hash representation improvement (or fix) | |
| ruby-1.9.2-head :001 > {a: "b"} | |
| => {:a=>"b"} | |
| ruby-1.9.2-head :002 > {a: "b"}.to_s | |
| => "{:a=>\"b\"}" | |
| should become: | |
| ruby-1.9.2-head :001 > {a: "b"} |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Deletes a line from a file - unix semicolun notation - file:line | |
| # Usage: | |
| # | |
| path, line_number = ARGV[0].split(":") | |
| file = "" | |
| File.open(path).readlines.each_with_index do |line, idx| |
This file contains hidden or 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
| <html><body> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | |
| <script type='text/javascript'> | |
| $(function(){ | |
| var query = "ubuntu" | |
| var element = "#thorrents" | |
| var limit = 5 | |
| // TODO: jquery function - $("element").thorrents() | |
| var domain = "thorrents.com" |
This file contains hidden or 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" } | |
| :plain | |
| $(function(){ | |
| var query = "ubuntu" | |
| var element = "#thorrents" | |
| var limit = 5 | |
| // TODO: jquery function - $("element").thorrents() | |
| var domain = "thorrents.com" | |
| var url = 'http://'+domain+'/search/'+query+'?callback=?' |
This file contains hidden or 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
| { | |
| "results": [{ | |
| "name": "ubuntu desktop 10.10 i386", | |
| "magnet": "magnet:?xt=urn:btih:bcf2e587afd4d3....80%2Fannounce", | |
| "seeds": "157" | |
| }, { | |
| "name": "Ubuntu 10.10 amd64", | |
| "magnet": "magnet:?xt=urn:btih:4af6fb7cbfb87....80%2Fannounce", | |
| "seeds": "63" | |
| }, { |
This file contains hidden or 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
| # v 1.0.1 | |
| ~$ ARCHFLAGS='-arch i386 -arch x86_64' | |
| ~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes | |
| ~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.1/RubyCocoa-1.0.1.tar.gz/download | |
| ~$ tar xzf RubyCocoa-1.0.1.tar.gz && rm RubyCocoa-1.0.1.tar.gz && cd RubyCocoa-1.0.1 | |
| ~/RubyCocoa-1.0.1$ ruby install.rb config --build-universal=yes | |
| ~/RubyCocoa-1.0.1$ ruby install.rb setup | |
| ~/RubyCocoa-1.0.1$ sudo ruby install.rb install |
This file contains hidden or 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
| // mixins | |
| =border-radius(!radius) | |
| border-radius = !radius | |
| -moz-border-radius = !radius | |
| -webkit-border-radius = !radius | |
| =border-radius-bottom(!radius) | |
| -moz-border-radius-bottomleft= !radius | |
| -moz-border-radius-bottomright= !radius | |
| -webkit-border-bottom-left-radius= !radius |
This file contains hidden or 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
| def entries(dir) | |
| Dir.entries(dir) - ["..", "."] | |
| end | |
| def entries_map(directory, level=1, &block) | |
| entries(directory).map do |dir| | |
| if File.directory? "#{directory}/#{dir}" | |
| puts "#{">"*level} #{dir}" | |
| block.call "#{directory}/#{dir}" | |
| end |
This file contains hidden or 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 PagesController < ActionController::Metal | |
| include AbstractController::Layouts | |
| include ActionController::Rendering | |
| append_view_path "#{Rails.root}/app/views" | |
| layout "application" | |
| def about | |
| render :about | |
| end |
This file contains hidden or 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 debugg_multiple(elements, attrs) { | |
| if (attrs == undefined) | |
| attrs = []; | |
| string = ""; | |
| for (var i = elements.length - 1; i >= 0; i--){ | |
| string = string + debugg(elements[i], attrs) + "<br>"; | |
| }; | |
| return string; | |
| } |