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
| blueprint: | |
| name: Appliance has finished | |
| description: Do something when an appliance (like a washing machine or dishwasher) | |
| has finished as detected by a power sensor. | |
| domain: automation | |
| input: | |
| power_sensor: | |
| name: Power Sensor | |
| description: 'Power sensor entity (e.g. from a smart plug device).' | |
| selector: |
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
| # This doesn't seem to work because the before(:each) is not called before the inner before(:all) is run... | |
| context "when updating" do | |
| before(:each) { @bible = create(:bible, code: 'OLD_CODE', alias: 'OLD_ALIAS') } | |
| context "when not updating alias" do | |
| before(:all) do | |
| @bible.update_attributes(name: 'Different Name', code: 'UPDATED') | |
| end | |
| it "should have the updated title" do |
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
| dnsimple_credentials = Chef::EncryptedDataBagItem.load("secrets", "dnsimple", Chef::EncryptedDataBagItem::DEFAULT_SECRET_FILE) | |
| if dnsimple_credentials && dnsimple_credentials['domains'].include?(node[:domain]) | |
| include_recipe 'dnsimple' | |
| dnsimple_record "#{node['hostname']}.#{node['domain']}" do | |
| domain node['domain'] | |
| content node['ipaddress'] | |
| type "A" | |
| action :create |
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
| 2x classes - Topic and TopicTerm | |
| Topic embeds many topic_terms | |
| I can find topics by using elemMatch: | |
| def self.find_by_ref(reference) | |
| where({:topic_terms => {'$elemMatch' => {:references => /^#{reference}(?:\.[0-9]+|$)/}}}) | |
| end | |
| I then get an array of Topic objects back, where I can do: |
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
| Pro Git - http://git-scm.com/book | |
| http://think-like-a-git.net/ | |
| VIDEOS: | |
| Randal Schwartz: | |
| http://vimeo.com/35778382 | |
| http://www.slideshare.net/RandalSchwartz/introduction-to-git-11451326 |
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
| # From: http://web.icedsl.hu/enicke/mcprtc/mcpcode.html | |
| #include <Wire.h> | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| Wire.begin(); | |
| } |
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
| $ vagrant basebox build 'myubuntubox' | |
| Verifying the isofile ubuntu-10.10-server-i386-netboot.iso is ok. | |
| We found no good state so we are destroying the previous machine+disks | |
| VBoxManage unregistervm 'myubuntubox' --delete | |
| Deleting vm myubuntubox | |
| Creating vm myubuntubox : 384M - 1 CPU - Ubuntu | |
| Creating new harddrive of size 10140 | |
| VBoxManage createhd --filename '/Users/ian/VirtualBox VMs/myubuntubox/myubuntubox.vdi' --size '10140' --format vdi > /dev/null | |
| Attaching disk: /Users/ian/VirtualBox VMs/myubuntubox/myubuntubox.vdi |