Skip to content

Instantly share code, notes, and snippets.

View michelson's full-sized avatar
🏠
Working from home

Miguel Michelson Martinez michelson

🏠
Working from home
View GitHub Profile
@michelson
michelson / python config
Last active February 9, 2016 03:38
config python for blender
- install pythonz
- sudo pythonz install 3.4.1
- pythonz locate 3.4.1
- cd /Applications/Blender.app/Contents/Resources/2.75/
- virtualenv -p PATH_TO_PYTHON3 python
- bin/pip install python-osc
- then, the copy folder to blender python
{
"development": {
"hosts": [
"127.0.0.1:9160"
],
"keyspace":"dev_events"
}
}
@michelson
michelson / blender-cheatsheet.md
Created January 24, 2016 19:29
Blender Hotkeys Cheatsheet-Tufts OCW Blender Design 2.6x

Blender Hotkeys Cheatsheet-Tufts OCW Blender Design 2.6x

General

  • ESC Stops ongoing operation
  • TAB Toggles Edit/Object mode
  • ZKEY Toggles Solid/Wireframe display
  • CTRL-Z Undo
  • SHIFT-CTRL-Z Redo
  • CTRL-N Open New Default File
@michelson
michelson / test_mail_catcher.rb
Created August 3, 2015 20:44
mail catcher for rails env
if Rails.env.test?
class MailCatcher
def self.create(opts)
File.open("#{Rails.root}/tmp/mailcatcher/mail-#{Time.now.to_i}.html", 'w') do |f|
f.write(opts[:body].raw_source)
end
end
end
package main
import (
"bytes"
"flag"
"fmt"
//"log"
"os"
"os/exec"
"strings"
@michelson
michelson / time_parser.go
Created July 17, 2014 20:33
parse time string like 1.minutes, 2.minutes , 3.hours , 3.hrs
package main
import(
"time"
"strings"
"strconv"
"fmt"
"errors"
)
default: build
build:
./make.sh build
run:
./make.sh run
deps:
@michelson
michelson / picker_with_search_row.rb
Last active January 1, 2016 17:18
Formotion Picker with search bar
module Formotion
module RowType
class PickerWithSearchRow < PickerRow
include RowType::ItemsMapper
def after_build(cell)
super
@items_for_search = items
keyboardDoneButtonView = UIToolbar.new
keyboardDoneButtonView.barStyle = UIBarStyleBlack
# app/cells/museo_table_view_cell.rb
class StyledCell < UITableViewCell
attr_accessor :image_cell, :title_cell, :subtitle_cell
#stylesheet :main_screen
def layoutSubviews
p title_cell
p subtitle_cell

RAILS_RELATIVE_URL_ROOT

Rails

By default RAILS_RELATIVE_URL_ROOT is used only for asset pipeline.

To namespace your rails routes you need to wrap run MyApp::Application with map in your config.ru:

map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do