Skip to content
View ns-cheatsheet.clj
;; * :require makes functions available with a namespace prefix.
;; * :use makes functions available without a namespace prefix
;; (i.e., refers functions to the current namespace).
;; * :import refers Java classes to the current namespace.
View super.js
App = { fields: {}, field: {} };
App.field.Field = function(){
this.callSuper = function(args){
var name = arguments.callee.caller.$name;
var parent = new this.parent;
parent[name].apply(this, args);
this.render = function(json){
console.log("Field", json);
View test_induced_design.rb
require 'spec_helper'
describe EmployeesController do
let(:employee_params) { ... }
describe "POST create" do
it "should create bla bla bla" do
employee = mock_model(Employee, id: 666)
Employee.should_receive(:create).with(employee_params).and_return employee
post :create, employee: employee_params
View export.rb
namespace :export do
desc "Gerando SEED"
task :gerar => :environment do"/Users/cmilfont/projetos/bookmaker/lib/tasks/import.rake", "w:UTF-8") do |file|
file.write "#encoding: UTF-8 \n"
file.write "namespace :import do \n"
file.write " task :all => :environment do \n"

Keybase proof

I hereby claim:

  • I am cmilfont on github.
  • I am cmilfont ( on keybase.
  • I have a public key whose fingerprint is 4EF8 2397 E9A0 1C40 842D A5BA 1F08 24CF BBA5 A937

To claim this, I am signing this object:

View quadro.rb
require 'spec_helper'
describe Quadro do
describe "#mover", %q{
Como um usuário
Eu quero mover um cartão de um quadro para outro
Para definir o status do cartão
} do
View solr.xml
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/root/atlas/shared/solr/solr.war" antiResourceLocking="false" privileged="true">
<Environment name="solr/home" type="java.lang.String" value="/root/atlas/shared/solr_home" override="true"/>
<!-- /etc/tomcat6/Catalina/localhost/solr.xml -->
View gist:8522608
1) stopping all running solr processes
2) removing the solr folder BUT keep a copy of it accessible in case you need some of the old config, synonyms and such.
3) gem uninstall all related gems
> for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
4) bundle install
5) rails generate sunspot_rails:install
View pasteFromClipboard.js
document.onpaste = function(event){
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
console.log(JSON.stringify(items)); // will give you the mime types
var blob = items[0].getAsFile();
var reader = new FileReader();
reader.onload = function(event){
console.log(}; // data url!
View app.js
var express = require('express');
var app = express.createServer();
base: function(){
// return the app's mount-point
// so that urls can adjust. For example
// if you run this example /post/add works
Something went wrong with that request. Please try again.