I wanted to do this with the popular gem:
class User < ActiveRecord::Base
popular
after_befriend :notify_friend
def notify_friend(friend)
puts "#{self.username} followed #{friend.username}"
end
diff --git a/app/controllers/add_photos.coffee b/app/controllers/add_photos.coffee | |
index db7e209..b269ecb 100644 | |
--- a/app/controllers/add_photos.coffee | |
+++ b/app/controllers/add_photos.coffee | |
@@ -7,6 +7,13 @@ $.photoOptionDialog.addEventListener "click", (e) -> | |
newPhoto() if e.index is 0 | |
existingPhoto() if e.index is 1 | |
+cachick = Ti.UI.createButton | |
+ title: 'CACHICK' |
openURL = (url, protocol='http') -> | |
Ti.Platform.openURL "#{protocol}://#{url}" | |
openApp = (e) -> | |
if e?.index == 1 | |
protocol = e.source.alternativeProtocol | |
# Add Google Chrome specific callback params | |
if e.source.alternativeProtocol == 'googlechrome-x-callback' | |
url = "x-callback-url/open/?" |
require "rest_client" | |
require "twitter" | |
URL = "http://www.oge.com/residential-customers/products-and-services/" + | |
"Positive-Energy-Smart-Grid/Pages/PriceSignal.aspx" | |
DATE_RE = Time.now.strftime("%A,\\s+%B\\s+%d,\\s+%Y") | |
unless ARGV.size == 4 | |
abort "USAGE: #{$PROGRAM_NAME} CONSUMER_KEY CONSUMER_SECRET " + | |
"OAUTH_TOKEN OAUTH_TOKEN_SECRET" |
#!/usr/bin/env ruby | |
# To get pi_piper on Raspbian: | |
# | |
# apt-get install ruby-dev | |
# gem install pi_piper --no-ri --no-rdoc | |
# gem install rb-inotify --no-ri --no-rdoc | |
# | |
# These pins work but send a weird signal at boot. | |
# | |
# This script will take a string array and output it to the outputs on the shift register |
class Safaritabswitching < Cask | |
url 'https://github.com/rs/SafariTabSwitching/releases/download/1.2.6/Safari.Tab.Switching-1.2.6.pkg' | |
homepage 'https://github.com/rs/SafariTabSwitching' | |
version '1.2.6' | |
sha256 :no_check | |
install 'Safari.Tab.Switching-1.2.6.pkg' | |
uninstall :script => { :executable => 'uninstall.tool', :input => %w[Yes] } | |
end |
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Gemfile: | |
# source "https://rubygems.org" | |
# | |
# gem 'spotify' | |
# gem 'pry' | |
require "bundler/setup" |
I wanted to do this with the popular gem:
class User < ActiveRecord::Base
popular
after_befriend :notify_friend
def notify_friend(friend)
puts "#{self.username} followed #{friend.username}"
end
#!/usr/bin/env bash | |
# Ensure compiler isn't already installed | |
[[ -d /usr/local/gcc_arm/ ]] && echo 'gcc_arm already installed. Aborting...' && exit 1 | |
echo '---> Downloading gcc arm to your current directory' | |
[[ ! -f gcc-arm-none-eabi-4_8-2014q2-20140609-mac.tar.bz2 ]] && \ | |
curl https://s3.amazonaws.com/ericboehs-uploads/gcc-arm-none-eabi-4_8-2014q2-20140609-mac.tar.bz2 > gcc-arm-none-eabi-4_8-2014q2-20140609-mac.tar.bz2 | |
# Rehosted on Amazon S3 as launchpad is really slow. | |
# If you are uncomfortable downloading from an unknown source, replace the above with: |
#! /usr/bin/env bash | |
# | |
# You will need the spark core cli installed first (and nodejs): | |
# npm install -g spark-cli | |
# spark cloud login | |
# | |
# To set SSID and PASSPHRASE, change below or run: | |
# git config spc.wifi.ssid YOUR_SSID | |
# git config spc.wifi.passphrase YOUR_PASSPHRASE |
# These two aliases will allow you to check out the BRANCH that a PR is | |
# associated with by PR ID (gcopr) and also merge a pull request by ID into | |
# master (gmpr). | |
# | |
# I use this in conjunction with the ghi gem to allow me to review and merge pull | |
# requests from the command line. To show open pull requests (I alias this to `prs`): | |
# | |
# ghi list | grep --color=auto '↑' --color=none | |
# Git checkout pull request by ID |