Create a simple java app that adds two ints
// Plusser.java
package org.apache.hadoop.hive.contrib.udf.example;
import org.apache.hadoop.hive.ql.exec.UDF;
public class Plusser extends UDF{
public Integer evaluate(Integer a, Integer b){
| I had this same issue this morning. I was able to fix it by deleting all my gems, and then running bundle config path 'vendor/bundle' so it installs the gems inside your app directory (since rbenv has no gemsets), bundle install again, a quick rbenv rehash, and then everything seemed to work again with the newer syntax. I think rbenv for some reason was running my powder gem out of another ruby version and not the current one. I do admit, it was a pretty weird issue, but I was able to get it working. |
| for branch in `git branch -r | grep -Ev 'origin/master|origin/staging|heroku/'`; do echo;echo $branch && git log --pretty='%C(white)%h%C(green) %ad %C(yellow)%aN' --date=short $branch -1; done |
| def nested_keys(h) | |
| th = {"keys" => h.keys.sort} | |
| h.each{|k,v| th[k] = nested_keys(h[k]) if h[k].class == Hash } | |
| th | |
| end | |
| nested_keys(h1).diff(nested_keys(h2)) |
| map <leader>r :exec "!bundle exec rspec %\:".line('.')<cr> |
Create a simple java app that adds two ints
// Plusser.java
package org.apache.hadoop.hive.contrib.udf.example;
import org.apache.hadoop.hive.ql.exec.UDF;
public class Plusser extends UDF{
public Integer evaluate(Integer a, Integer b){
| d=0 | |
| until [ $DATE = `date -d "-$d days" +%Y/%m/%d` ]; do | |
| let d+=1 | |
| if [ 2011/07/14 = `date -d "-$d days" +%Y/%m/%d` ]; then | |
| echo "fail - date $DATE_STRING not in acceptable range (2012/07/15-current)" >&2 | |
| exit -1 | |
| fi | |
| done | |
| for days_back in {1..4}; do |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| :'<,'>!pbcopy & pbpaste |
bash call
find app/ | grep ".rb$" | ./find_methods.rb
find_methods.rb
#!/usr/bin/env ruby -n
file_name = $_.chomp
| require 'hmac-sha1' | |
| require 'base64' | |
| require 'cgi' | |
| module OauthHelper | |
| def URLEscape(text) | |
| return CGI.escape(text).gsub("+", "%20") | |
| end | |