Rails flash messages with AJAX requests & twitter-bootstrap 2.3
Forked from https://gist.github.com/linjunpop/3410235 Based on Stackoverflow answer: http://stackoverflow.com/a/10167659/656428
License: MIT
function go() { | |
var userId = prompt('Username?', 'Guest'); | |
// Consider adding '/<unique id>' if you have multiple games. | |
var gameRef = new Firebase(GAME_LOCATION); | |
assignPlayerNumberAndPlayGame(userId, gameRef); | |
}; | |
// The maximum number of players. If there are already | |
// NUM_PLAYERS assigned, users won't be able to join the game. | |
var NUM_PLAYERS = 4; |
class Photo < ActiveRecord::Base | |
#... | |
def image_url *args | |
url = super | |
url.gsub!('.', '@2x.') if args[0] == :square_thumb #add @2x to filename if square_thumb is requested | |
url | |
end | |
Rails flash messages with AJAX requests & twitter-bootstrap 2.3
Forked from https://gist.github.com/linjunpop/3410235 Based on Stackoverflow answer: http://stackoverflow.com/a/10167659/656428
License: MIT
A list of Sketch plugins hosted at GitHub, in no particular order.
#!/usr/bin/env perl | |
# | |
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder | |
use strict; | |
use warnings; | |
use URI::Escape qw(uri_escape_utf8); | |
use open IO => ":utf8", # UTF8 by default | |
":std"; # Apply to STDIN/STDOUT/STDERR |
# app/serializers/customer_serializer_spec.rb | |
class CustomerSerializer < ActiveModel::Serializer | |
attributes :customer_number, :email, :username | |
def customer_number | |
object.account_number | |
end | |
def merchant_id |
module ApplicationHelper | |
# Using raw files | |
def embedded_svg filename, options = {} | |
root = options[:root] || Rails.root.join("app", "assets", "svgs") | |
file = File.read(File.join(root, filename)) | |
doc = Nokogiri::HTML::DocumentFragment.parse file | |
svg = doc.at_css 'svg' | |
svg['class'] = options[:class] if options[:class].present? | |
doc.to_html.html_safe | |
end |
The only way to get working Homebrew on OS X 10.10 for now (10.10 beta was just released a couple of hours ago) is by using an special fork by @jacknagel available at https://github.com/jacknagel/homebrew/tree/rb2.
To install this working version of Homebrew just execute:
ruby -e "$(curl -fsSL https://gist.githubusercontent.com/jpincheira/bd3698fee46735fac252/raw/2c6a2f81927871c1a64e2dfbbc5eef451c71a9ac/homebrew.rb)"
// Usage: | |
// $('.box').parentToAnimate($('.new-parent'), 200); | |
// $('.box').parentToAnimate($('.new-parent'), 'slow'); | |
// $('.box').parentToAnimate('.new-parent', 'slow'); | |
jQuery.fn.extend({ | |
// Modified and Updated by MLM | |
// Origin: Davy8 (http://stackoverflow.com/a/5212193/796832) | |
parentToAnimate: function(newParent, duration) { | |
duration = duration || 'slow'; |
Add the following to ~/.bash_profile
(create the file if it does not exist by typing touch ~/.bash_profile
into terminal. The touch
command simply creates a file if it does not exist):
export THEOS=/opt/theos
export PATH=$THEOS/bin:$PATH
export THEOS_DEVICE_IP=your_idevice_ip THEOS_DEVICE_PORT=22