Skip to content

Instantly share code, notes, and snippets.

View dam13n's full-sized avatar

Damien Sutevski dam13n

View GitHub Profile
class HomeController < UIViewController
include BW::KVO
def viewWillAppear(animated)
super
end
def viewDidLoad
super
messagesRef = Firebase(url: "https://swift-chat.firebaseio.com/messages")
// *** STEP 4: RECEIVE MESSAGES FROM FIREBASE
messagesRef.observeEventType(FEventType.ChildAdded, withBlock: { (snapshot) in
let text = snapshot.value["text"] as? String
let sender = snapshot.value["sender"] as? String
let imageUrl = snapshot.value["imageUrl"] as? String
let message = Message(text: text, sender: sender, imageUrl: imageUrl)
self.messages.append(message)
ar atrString: NSMutableAttributedString = NSMutableAttributedString(string: stubstring)
var wordstring : String
for wordstring in words {
if wordstring.hasPrefix("@"){
@dam13n
dam13n / gist:efcac8ee7217d93a0173
Created July 23, 2014 16:57
thor orders on staging
ubuntu@ip-172-31-36-13:/var/deploy/dstld-wtf/web_head/current$ thor orders:seed [email protected] 5
/usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- factory_girl (LoadError)
from /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from lib/thor/orders.thor:1:in `load_thorfile'
from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/util.rb:155:in `class_eval'
from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/util.rb:155:in `load_thorfile'
from /var/deploy/dstld-wtf/web_head/releases/20140723005632/Thorfile:2:in `block in load_thorfile'
from /var/deploy/dstld-wtf/web_head/releases/20140723005632/Thorfile:1:in `glob'
from /var/deploy/dstld-wtf/web_head/releases/20140723005632/Thorfile:1:in `load_thorfile'
from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/util.rb:155:in `class_eval'
Group.create!([
{name: "Black is the New Black", short_body: "Black is the New Black", short_body_html: "<p>Black is the New Black</p>\n", long_body: "Black is the New Black", long_body_html: "<p>Black is the New Black</p>\n", slug: "black-is-the-new-black", featured_homepage: nil, permalink: "black-is-the-new-black", category_display: "slider"},
{name: "New Arrivals", short_body: "", short_body_html: "", long_body: "", long_body_html: "", slug: "new-arrivals", featured_homepage: 1, permalink: "new-arrivals", category_display: "banner"},
{name: "Black Powerstretch", short_body: "Empowerment through Powerstretch", short_body_html: "<p>Empowerment through Powerstretch</p>\n", long_body: "", long_body_html: "", slug: "black-powerstretch", featured_homepage: nil, permalink: "black-powerstretch-jeans", category_display: "banner"},
{name: "Forever White", short_body: "Dazzling, enduring white hue. Astonishing handfeel.", short_body_html: "<p>Dazzling, enduring white hue. Astonishing handfeel.</p>\n", long
#portion from routes.rb
Spree::Core::Engine.add_routes do
namespace :admin do
resources :users do
member do
get :impersonate
end
end
resources :orders, only: [] do