https://github.com/StephanHoyer/mithril-isomorphic-example
https://github.com/lhorie/mithril.js/wiki/Community-Projects#starter-kits
# ruby -n option: Causes Ruby to assume the following loop around your script, which makes it iterate over file name | |
# arguments somewhat like sed -n or awk. | |
# | |
# Example: | |
curl -s http://www.gutenberg.org/files/1080/1080.txt | | |
ruby -ne ' | |
BEGIN { $words = Hash.new(0) } | |
$_.split(/[^a-zA-Z]+/).each { |word| $words[word.downcase] += 1 } |
Dear Rubysts: | |
Did you know that Ruby can even read your emails? | |
#!/usr/bin/env ruby -w | |
puts "It's true." | |
__END__ |
class Module | |
def method_added(name) | |
unless @_admin_only.nil? or @_proxy_method | |
@_proxy_method = true | |
alias_method "_admin_#{name}", name | |
module_eval <<-STRING | |
def #{name}(*args, &block) | |
_admin_#{name}(*args, &block) if admin? | |
end | |
STRING |
# instead of: class User < Struct.new(:first, :last) ... end | |
User = Struct.new(:first, :last) do | |
def full | |
"#{first} #{last}" | |
end | |
end | |
james = User.new('James', 'Gray') |
<h1 id="qunit-header">Unit Tests</h1> | |
<h2 id="qunit-banner"></h2> | |
<div id="qunit-testrunner-toolbar"></div> | |
<ol id="qunit-tests"></ol> | |
<div id="qunit-fixture"></div> |
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> | |
<script type="text/javascript"> | |
tinymce.init({ | |
selector: "textarea" | |
}); | |
function getRichContent(){ |
pv ubuntu-14.10-desktop-amd64.img.dmg | sudo dd of=/dev/rdisk3 bs=1m | |
pv ~/Desktop/linuxmint.iso | sudo dd of=/dev/sdx oflag=direct bs=1048576 |
/opt/mxhero-apps/footers-web/shared/log/*.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 0640 ubuntu ubuntu | |
sharedscripts | |
postrotate |
void function(m) { | |
function closure(fn) { | |
var component = { | |
controller : function(options) { | |
component.view = fn(options); | |
} | |
}; | |
return component; |