Skip to content

Instantly share code, notes, and snippets.

View aaronmoodie's full-sized avatar
Coffee

Aaron Moodie aaronmoodie

Coffee
View GitHub Profile
# html
# place under div.email (92)
<div class="gifts-newsletter">
<input type="checkbox" name="etsy_gift" id="etsy_gift"> <label for="etsy_gift">I'd also like great gift ideas from Etsy.</label>
</div>
# css
# place under form div.email (314)
.reminder p {
1.9.2p290 :002 > require 'taglib'
=> true
1.9.2p290 :003 > TagLib::MPEG::File.new('taro.mp3') do |file|
1.9.2p290 :004 > tag = file.tag
1.9.2p290 :005?> puts "#{file}: #{tag.title} by #{tag.artist}; track #{tag.track} on #{tag.album}"
1.9.2p290 :006?> end
=> #<TagLib::MPEG::File:0x007f9cea923770>
[5] pry(main)> file = TagLib::MPEG::File.new('taro.mp3')
=> #<TagLib::MPEG::File:0x007f852353ec88 @__swigtype__="_p_TagLib__MPEG__File">
[6] pry(main)> tag = file.tag
=> #<TagLib::Tag:0x007f852350a870 @__swigtype__="_p_TagLib__Tag">
[7] pry(main)> puts "#{file}: #{tag.title} by #{tag.artist}; track #{tag.track} on #{tag.album}"
#<TagLib::MPEG::File:0x007f852353ec88>: Taro by alt-J; track 13 on An Awesome Wave
=> nil
[8] pry(main)>
@aaronmoodie
aaronmoodie / gist:5401127
Last active December 16, 2015 07:48 — forked from dnch/gist:5392985
class Show < ActiveRecord::Base
attr_accessible :artist_tokens, :cost, :booking_url, :door_charge, :venue_id, :date, :time, :starts_at
attr_reader :artist_tokens, :date, :time
validate :is_time
validate :is_date
before_save :save_date_and_time
has_many :performances
has_many :artists, :through => :performances
@aaronmoodie
aaronmoodie / gitCommands.bash
Last active August 29, 2015 13:55
My Collection of git commands
$ git log #show commit history
$ git revert <hash> # reverts changes in that commit
$ git show <hash> | gist -t diff # create diff of commit and pipe to gist
$ git diff —staged # show diff of added (staged files)
$ git rebase -i # interactive rebase
$ git rebase —abort # undo a rebase
$ git cherrypick <hash> # moves a commit from one branch to another
$ git push origin <branch> # push review/branch to github
$ git commit —amend # add changes to the last commit
$ git stash show <stash name> # view changes in stash

Keybase proof

I hereby claim:

  • I am aaronmoodie on github.
  • I am aaronmoodie (https://keybase.io/aaronmoodie) on keybase.
  • I have a public key whose fingerprint is 09BE 3685 A583 684F 5776 FB2B 88EE 7158 C521 01D2

To claim this, I am signing this object:

<script>
var meta_tag = document.createElement('meta');
meta_tag.setAttribute('name', 'last-modified')
meta_tag.setAttribute('content', document.lastModified)
document.getElementsByTagName('head')[0].appendChild(meta_tag)
</script>
int main(int argc, const char * argv[])
{
int x = 0;
int *pointer_to_x = &x; // * is used to do declaration (use & to get the address of x in memory)
*pointer_to_x = 1; // * is a dereference operator
//x is now equal to 1
printf("*pointer_to_x points to the value %i\n", *pointer_to_x);
printf("pointer_to_x is located at the address %p\n\n", pointer_to_x);
> function Element() {}
undefined
> Element.prototype.render = function() {};
[Function]
> var e = new Element();
undefined
> e.render();
undefined
> e.toString();
'[object Object]'
create_table "product", :force => true do |t|
t.string "name"
t.enum "type" # booklet, tutorial etc
end
create_table "physical_product", :force => true do |t|
t.integer "product_id"
# unique attrs
end