This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script resizes a sparsebundle and locks the Info.plist to prevent timemachine resizing it. | |
# Usage | |
# resize.sh MacBook.sparsebundle 100g | |
# which resizes the sparse bundle to 100GB | |
echo "unlocking Info.plist" | |
SetFile -a l "${1%/}/Info.plist" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "meme" do | |
url = "http://www2b.abc.net.au/votecentral/Client/PlaceVote.aspx?E=96&IX=0&IG=2" | |
doc = Nokogiri::HTML(open(url)) | |
list = doc.at("div .IndexPageContent") | |
list = list.at("p") | |
list.css("span .artist").each do |item| | |
puts "#{item.text} - #{ item.next_element.next_element.text}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "spec_helper" | |
describe ApplicationController do | |
controller do | |
def index | |
render nothing: true | |
end | |
end | |
let(:user) { create(:user_agent) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.report | |
from_date = '20130401' | |
entities = Entity.unscoped.where('updated_at > ?', from_date).where('type in (?)', ['Contact', 'Deceased', 'Child']).where(culture_id: [Selection.culture_australian_aboriginal.id, Selection.culture_australian.id]).order(:site_id, :type) | |
p entities.length | |
media_items = MediaItem.unscoped.where('updated_at > ?', from_date) | |
p media_items.length | |
entities = Entity.unscoped.where('updated_at > ?', from_date).where('type in (?)', ['Contact', 'Deceased', 'Child']).where(referral_source_id: [Selection.referral_source_internet.id, Selection.referral_source_information_session.id]).order(:site_id, :type) | |
p entities.length | |
entities = Entity.unscoped.where('updated_at > ?', from_date).where('type in (?)', ['Contact', 'Deceased', 'Child']).where(relation_id: [Selection.relation_friend.id, Selection.relation_support_1.id]).order(:site_id, :type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="ticket[priority_id]"> | |
<option value="low">Low</option> | |
<option value="medium">Medium</option> | |
<option value="high">High</option> | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create_table :priorities do |t| | |
t.string :name | |
t.boolean :default | |
t.boolean :archived | |
t.integer :position | |
t.timestamps | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b>Priority:</b> | |
<%= @ticket.priority.try(:name) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b>Priority:</b> | |
<%= @ticket.priority.name %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new.html.haml | |
%h1 New vendor | |
= render 'form' | |
= link_to 'Cancel', vendors_path, id: :cancel_new_vendor_link | |
--------------------- | |
_form.html.haml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Company < ActiveRecord::Base | |
has_many :contacts | |
class Contact < ActiveRecord::Base | |
belongs_to :company |
OlderNewer