Skip to content

Instantly share code, notes, and snippets.

@staycreativedesign
staycreativedesign / deploy.rb
Created May 8, 2017 05:19
mina nginx server restart
#There is a plugin called mina-nginx which is overkill all I am trying to do is restart my nginx after I deploy my sinatra app. I have this code
require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
require 'mina/rvm' # for rvm support. (https://rvm.io)
set :domain, 'dot'
set :deploy_to, 'foo'
set :repository, 'bar'
/Users/mindblown/.rvm/gems/ruby-2.4.1@g/gems/bundler-1.14.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels)in require': There was an error while trying to load the gem 'faker'.
Gem Load Error is: superclass mismatch for class Mark
Backtrace for gem load error is:
/Users/mindblown/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych/parser.rb:34:in `<class:Parser>'
/Users/mindblown/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych/parser.rb:33:in `<module:Psych>'
/Users/mindblown/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/psych/parser.rb:2:in `<top (required)>'
/Users/mindblown/.rvm/gems/ruby-2.4.1@g/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
/Users/mindblown/.rvm/gems/ruby-2.4.1@g/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block inrequire'
/Users/mindblown/.rvm/gems/ruby-2.4.1@g/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/Users/mindblown/.rvm/gems/ruby-2.4.1@g/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:2
require 'rails_helper'
RSpec.feature "Administrator logs in" do
before(:each) do
@admin = build_stubbed(:user, role: "admin")
end
scenario "with valid credentials" do
visit new_user_session_path
fill_in "Email", with: @admin.email
@staycreativedesign
staycreativedesign / _index.haml
Last active May 27, 2017 03:48
how can I achiever this : when user uploads an image and the image is done uploading it automatically appears on the page?
#/admin/photos/_index.haml
.container.index
.row
.col-md-12
%h1.text-uppercase Photos
%hr
- @photo_session.photos.each_slice(4) do |photos|
.row
- photos.each do |photo|
.col-md-3
class CreatePrivateRooms < ActiveRecord::Migration[5.0]
def change
create_table :private_rooms do |t|
t.timestamps
t.string :name
end
end
end
rake aborted!
ExecJS::ProgramError: TypeError: Cannot assign to read only property '__esModule' of #<Object>
Object.<anonymous> ((execjs):16301:20)
s ((execjs):52:626)
(execjs):52:677
Object.<anonymous> ((execjs):831:15)
s ((execjs):52:626)
e ((execjs):52:797)
(execjs):52:815
(execjs):52:322
@staycreativedesign
staycreativedesign / adeck.swift
Last active July 6, 2017 02:04
first swift app attempt - major noobage!
// This is in Model directory
//
// Deck.swift
// PassingInfoToSegue
//
// Created by Gustavo Pares on 7/5/17.
// Copyright © 2017 Gustavo Pares. All rights reserved.
//
import Foundation
@staycreativedesign
staycreativedesign / points.swift
Last active July 7, 2017 22:32
whenever cell leaves the view, it becomes isHidden = True how do I have it where the animation actually changes the isHidden to false and it stays that way?
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return(finalPoints.count)
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let card = finalPoints[indexPath.row]
tableView.separatorStyle = .none
tableView.allowsSelection = false
tableView.bounces = false
//
// PointsController.swift
// PassingInfoToSegue
//
// Created by Gustavo Pares on 7/5/17.
// Copyright © 2017 Gustavo Pares. All rights reserved.
//
import UIKit
//
// CustomTableViewCell.swift
// PassingInfoToSegue
//
// Created by Gustavo Pares on 7/7/17.
// Copyright © 2017 Gustavo Pares. All rights reserved.
//
import UIKit