Skip to content

Instantly share code, notes, and snippets.

View wethu's full-sized avatar

Ellis wethu

  • Ellis Gray
  • Gold Coast
View GitHub Profile
@wethu
wethu / test.sh
Last active August 29, 2015 14:18
#!/bin/bash
# Fetch all the daily lists of ID that are unfulfilled
# Usage: RAILS_ENV=production ID=28774 ./daily_list
# Exports to: APP_DIR/script/csv_tmp/daily_list-TIMESTAMP.csv
# Author: Ellis Gray 2015
RAILS_ENV=${RAILS_ENV:-development}
DATE=$(date +"%Y%m%d%H%M")
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# ...
foos = [:bar, :baz]
namespace :foo do
foos.each do |f|
get "#{f.to_str}/new" => 'controller#new', :as => "new_#{f.to_str}"
end
end
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" STATUS LINE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
hi User1 guifg=#ffdad8 guibg=#880c0e
hi User2 guifg=#000000 guibg=#F4905C
hi User3 guifg=#292b00 guibg=#f4f597
hi User4 guifg=#112605 guibg=#aefe7B
hi User5 guifg=#051d00 guibg=#7dcc7d
hi User7 guifg=#ffffff guibg=#880c0e gui=bold
hi User8 guifg=#ffffff guibg=#5b7fbb
response = JSON.parse(Net::HTTP.get(URI.parse('https://api.instagram.com/v1/tags/myTag/media/recent?client_id=myClinetID')))
img = response["data"][0]["images"]["low_resolution"]["url"]
caption = response["data"][0]["caption"]["text"]
if Image.where(:url = img).blank?
saveImage = Image.create(:url => img, :text => caption)
end
When I run this, I get:
class DirectDeposit < ActiveRecord::Base
BANKS = %w(NAB POST).freeze
AlreadyReceived = Class.new(StandardError)
belongs_to :admin, :class_name => 'User'
belongs_to :completed_payment, :class_name => 'Payment'
belongs_to :purchaser, :class_name => 'User'
validates :purchaser, :purchase_amount, :purchase_type, :presence => true
# Problematic validations:
# validates :admin, :amount_received, :bank, :ref, :presence => true, :if => :received?
/Users/egray/Documents/www/microminimus/app/helpers/application_helper.rb:
10 # return tag unless tag =~ /assets\.cdn\./ # local
11
12: # # assets.cdn.staging.microminimus.com
13 # tag.
14: # gsub("assets.cdn.staging.microminimus.com", "cdn-staging-microminimus.pantherssl.com").
15 # gsub("assets.cdn.microminimus.com", "cdn-microminimus.pantherssl.com").
16 # html_safe + "blabla"
/Users/egray/Documents/www/microminimus/config/app_config.yml:
ssh -i ~/.ssh/github_rsa deploy@1234.servername.com
Host *.servername.com
Port 57896
User deploy
IdentityFile ~/.ssh/github_rsa
ForwardAgent yes
%section.v2
%article.about
%h2 [[t(:"updates.20120612.accessories.heading_2")]]
%p [[t(:"updates.20120612.accessories.text_2")]]
%p [[t(:"microminimus.splash_text")]]
%p [[t(:"microminimus.mm_link")]]
#bfl
%p
%a{:href => "http://microminimus.com/bikinis-for-life"}
%img{:src=>'http://wickedweasel.com/assets/images/microminimus/NEW-BIKINIS-FOR-LIFE-AD-WHITE.jpg '}
@wethu
wethu / update.rb
Last active August 29, 2015 14:16
=begin
Use script/runner to execute this file, eg:
~/g2 > script/runner script/publish_update.rb
=end
ActiveRecord::Base.transaction do
debug1: Found key in /Users/egray/.ssh/known_hosts:9
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey