start new:
tmux
start new with session name:
tmux new -s myname
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
| t = 236 # seconds | |
| Time.at(t).utc.strftime("%H:%M:%S") | |
| => "00:03:56" | |
| # Reference | |
| # http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
| shared_examples_for "driver with javascript support" do | |
| before { @driver.visit('/with_js') } | |
| describe '#find' do | |
| it "should find dynamically changed nodes" do | |
| @driver.find('//p').first.text.should == 'I changed it' | |
| end | |
| end | |
| describe '#drag_to' do |
| NOTE: I've created a gem based on this: https://github.com/natritmeyer/yarjuf | |
| --------- | |
| rspec my_spec.rb -r ./junit.rb -f JUnit -o results.xml |
| # It extends activeadmin to show pretty boolean values | |
| # | |
| # config/initializers/active_admin.rb | |
| module ActiveAdmin | |
| module Views | |
| class TableFor | |
| def bool_column(attribute) | |
| column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
| end |
| ;; eg when in a text file, (execute-shell-command-on-buffer "p4 edit %s") will check out the file in perforce | |
| (defun execute-shell-command-on-buffer (shell-command-text) | |
| (interactive "MShell command:") | |
| (shell-command (format shell-command-text (shell-quote-argument buffer-file-name))) | |
| ) |
| def select_from_chosen(item_text, options) | |
| field_id = find_field(options[:from])[:id] | |
| within "##{field_id}_chzn" do | |
| find('a.chzn-single').click | |
| input = find("div.chzn-search input") | |
| item_text.each_char do |char| | |
| input.base.invoke('keypress', false, false, false, false, char.ord, nil); | |
| end | |
| find('ul.chzn-results').click | |
| input.base.invoke('keypress', false, false, false, false, 40, nil); # down arrow |
| en: | |
| errors: | |
| messages: | |
| wrong_content_type: "is the wrong content type" |