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
> var total = 0 | |
undefined | |
> total += 4.4 | |
4.4 | |
> total += 4.4 | |
8.8 | |
> total += 4.4 | |
13.200000000000001 | |
var total = 0.0 | |
undefined |
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
> ping 172.17.5.108 | |
PING 172.17.5.108 (172.17.5.108) 56(84) bytes of data. | |
64 bytes from 172.17.5.108: icmp_seq=1 ttl=64 time=0.094 ms | |
64 bytes from 172.17.5.108: icmp_seq=2 ttl=64 time=0.063 ms | |
64 bytes from 172.17.5.108: icmp_seq=3 ttl=64 time=0.063 ms | |
^C | |
--- 172.17.5.108 ping statistics --- | |
3 packets transmitted, 3 received, 0% packet loss, time 1999ms | |
rtt min/avg/max/mdev = 0.063/0.073/0.094/0.016 ms |
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
routes.rb | |
map.term ':term', :controller => 'conference', :action => 'index' | |
index.rhtml | |
<% form_for :term, :url => { :controller => :conference, :action => :index }, :html => {:method => :get} do |f| %> | |
<input type="text" name="term" id="search" size="50" /> | |
<input type="submit" value="Submit" id="submit" /> | |
<% 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
public static string Test() | |
{ | |
return "abc"; | |
} |
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 HomeController < ApplicationController | |
def index() | |
post = Post.create({ | |
:title => 'John' | |
}) | |
post.save | |
@posts = Post.find(:all) | |
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
#!c:/ruby/bin/ruby.exe | |
require 'rubygems' | |
require 'rubygems/gem_runner' | |
require 'rubygems/exceptions' | |
def install(lib) | |
begin | |
Gem::GemRunner.new.run ['install', lib] | |
rescue Gem::SystemExitException => e | |
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
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask | |
AssemblyFile="3rdParty\CodePlex.MSBuildTasks.dll" | |
TaskName="CodePlex.MSBuildTasks.RegexReplace"/> | |
<UsingTask | |
AssemblyFile="3rdParty\CodePlex.MSBuildTasks.dll" | |
TaskName="CodePlex.MSBuildTasks.Unzip"/> | |
<UsingTask | |
AssemblyFile="3rdParty\CodePlex.MSBuildTasks.dll" |
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
require 'net/http' => true | |
require 'uri' | |
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), { 'files[file1.rb]' => "puts 'Hello World!'", 'files[file2.rb]' => "puts 'Gists example'"}) | |
puts res.body | |
#http://gist.github.com/240755 |
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
str = "a%sb%sc%s" | |
str % ['_', '/', '.'] | |
=> "a_b/c." |
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
def x() | |
yeild | |
end | |
x { puts 'abc' } |