Skip to content

Instantly share code, notes, and snippets.

{
"id": "/en/fantastic_mr_fox_2007",
"key": {
"namespace": "/source/fandango/movie",
"value": "fantasticmr.fox_109297nu",
"connect": "insert"
}
}
== Sinatra/0.9.4 has taken the stage on 4567 for development with backup from WEBrick
[2009-11-27 21:02:36] INFO WEBrick 1.3.1
[2009-11-27 21:02:36] INFO ruby 1.9.1 (2009-07-16) [i486-linux]
[2009-11-27 21:02:41] INFO WEBrick::HTTPServer#start: pid=7040 port=4567
^C
== Sinatra has ended his set (crowd applauds)
[2009-11-27 21:02:45] INFO going to shutdown ...
[2009-11-27 21:02:45] INFO WEBrick::HTTPServer#start done.
[2009-11-27 21:02:45] INFO WEBrick 1.3.1
[2009-11-27 21:02:45] INFO ruby 1.9.1 (2009-07-16) [i486-linux]
$remove = array();
foreach($company_names as $company_name) {
$remove_name = false;
foreach($company_names as $compare) {$remove_name = $remove_name || (strpos($compare, $company_name) == 0);}
if ($remove_name) {$remove[] = $company_name;}
}
$company_names = array_diff($company_names, $remove);
<?php
namespace ynd\thsx\core;
class Router {
protected $prefix;
protected $routes;
// Used in specificity calculations.
const MAX_PATH_SEGMENTS = 10;
public function __construct($routes, $prefix = NULL) {
$Locations_from_line =
array_map(
function($loc) {
return array_map(
function($part) {return trim($part);},
explode(',', $loc)
);
},
explode(';', $line['VC Portfolio URL'])
);
class BusinessUnit
include Mongoid::Document
field :name, :type => String
embeds_many :users
end
= semantic_form_for @user do |form|
= form.inputs do
= form.input :name, :label => 'Name'
= form.input :business_unit
= form.buttons
LazyStruct.new({:a=>1, :b => 2}).a # => 2
# That's wrong. Why?
@bkudria
bkudria / flymake-ruby.el
Created December 29, 2010 19:51
Steve Purcell's Ruby Flymake support, with stricter warnings.
;;; A flymake handler for ruby-mode files
;;;
;;; Author: Steve Purcell
;;; Homepage: http://github.com/purcell/emacs.d/blob/master/site-lisp/flymake-ruby/flymake-ruby.el
;;;
;;; Usage:
;;; (require 'flymake-ruby)
;;; (add-hook 'ruby-mode-hook 'flymake-ruby-load)