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
| while true ; do printf 'HTTP/1.1 200 OK\r\n\r\ncool, thanks' | netcat -l -c -p 8888 > incoming.txt ; done |
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 EventsController < ApplicationController | |
| before_filter :authenticate_user! | |
| def index | |
| end | |
| def show | |
| @event = Event.find_by_id(params[:id]) | |
| 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
| Breakfast | |
| ========= | |
| - Bada Bean | |
| - Paisely Cafe | |
| - Canopy Rd Cafe | |
| - Lucy Leas cupcakes | |
| Lunch | |
| ===== | |
| - Paisely Cafe |
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 won't work because "this" doesn't map to this object | |
| // when the click handler fires. | |
| { | |
| setupHandler: function () { | |
| $('button').click(function () {this.handleClicks}); | |
| }, | |
| handleClicks: function () { | |
| alert("I got clicked"); | |
| } | |
| } |
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
| // originally from: https://gist.github.com/1649063 | |
| $(function () { | |
| if (window.fluid) { | |
| setInterval(function(){ | |
| $('.image-preview-wrapper').not('.hideBtnAdded').each(function() { | |
| var t = $(this); | |
| if (t.find('.hideImg').length === 0) { | |
| t.append('<button class="hideImg">Hide This Image</button>'); |
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@vagrantup:/publisher$ bundle exec rails g model Platform::Subscription callback_url:string name:string external_id:string token:string secret:string verify_token:string service_id:string state:string type:string | |
| invoke active_record | |
| create db/migrate/20110714153150_create_platform_subscriptions.rb | |
| create app/models/platform/subscription.rb | |
| create app/models/platform.rb | |
| invoke rspec | |
| create spec/models/platform/subscription_spec.rb | |
| error factory_girl [not found] | |
| vagrant@vagrantup:/publisher$ cat db/migrate/20110714153150_create_platform_subscriptions.rbclass CreatePlatformSubscriptions < ActiveRecord::Migration | |
| def self.up |
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 upload_sizing; result = {:export => {use: []}} && (uploads_enabled? && (dims_upload = (upload_width? && upload_height? && { width: upload_width, height: upload_height }) || nil) || true) && (dims_thumb = (upload_thumb_width? && upload_thumb_height?) ? { width: upload_thumb_width, height: upload_thumb_height } : nil)) && [[enable_images?, dims_upload, :resize],[enable_images?, dims_thumb, :resize_thumb],[enable_videos?, dims_upload, :encode],[enable_videos?, dims_thumb, :encode_thumb]].inject(result) { |result, (cond, dims, key)| cond && dims && (result[key.to_sym] = dims) && (result[:export][:use] << key.to_s) }) || result; 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
| def upload_sizing | |
| result = {:export => {use: []}} | |
| if uploads_enabled? | |
| dims = (upload_width? && upload_height?) ? { width: upload_width, height: upload_height } : nil | |
| dims_thumb = (upload_thumb_width? && upload_thumb_height?) ? { width: upload_thumb_width, height: upload_thumb_height } : nil | |
| if enable_images? | |
| if dims | |
| result[:resize] = dims |
NewerOlder