Skip to content

Instantly share code, notes, and snippets.

@amite
amite / project_spec
Last active December 11, 2015 03:09
Project Spec Rspec test
require 'spec_helper'
describe Project do
context "while starting up" do
before do
options = {
name: 'Building house',
priority: 2,
tasks: []
@amite
amite / Omniauth.rb
Created February 12, 2013 07:24
Fix for faraday error with omniauth.rb
# First at the root of your project, do wget http://curl.haxx.se/ca/cacert.pem and then change the config/initializers/omniauth.rb file to point to the cert file
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, FACEBOOK_CONFIG['app_id'], FACEBOOK_CONFIG['secret'],
:scope => 'email,publish_actions', :display => 'popup',
:client_options => {:ssl => {:ca_file => "#{::Rails.root}/cacert.pem"}}
end
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Connecting to database specified by database.yml
[2013-02-12 13:52:54] INFO WEBrick 1.3.1
[2013-02-12 13:52:54] INFO ruby 1.9.3 (2012-04-20) [x86_64-darwin11.4.0]
[2013-02-12 13:52:54] INFO WEBrick::HTTPServer#start: pid=13578 port=3000
Cache read: http://localhost:3000/?
Dalli::Server#connect 127.0.0.1:11211
@amite
amite / error on vagrant up
Last active December 13, 2015 18:58
Error with Stagr script: http://stagr.gmanricks.com/
vagrant up
[default] Importing base box 'debian'...
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.
Guest Additions Version: 4.1.14
VirtualBox Version: 4.2.4
{a.grad-green-cta} AND {a.signup-button, a.page-download-button} share 19 rules
{a.grad-blue-cta} AND {a.grad-green-cta} share 17 rules
{div.cloud-plans ul.st_tabs li a} AND {div.feature-box ul.st_tabs li a} share 16 rules
{div.feature-box ul.st_tabs li a} AND {div.full-tab-block ul.st_tabs li a} share 16 rules
{a.page-download-button.blue} AND {a.signup-button, a.page-download-button} share 14 rules
{div.cloud-plans ul.st_tabs li a} AND {div.full-tab-block ul.st_tabs li a} share 13 rules
{a.grad-blue-cta}, {a.grad-green-cta}, {a.page-download-button.blue} AND {a.signup-button, a.page-download-button} share 13 rules
{.knowledge-center .featured-kc} AND {.resources .featured-article} share 12 rules
{a.grad-blue-cta} AND {a.page-download-button.blue} share 12 rules
{ul.sub-nav > li > a} AND {ul.sub-nav > li > ul > li > a} share 11 rules
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@amite
amite / support notes
Created June 7, 2013 10:03
Support section
# Support Section
* schedule a visit
* renew a pass - request a pass
* hotlist visitors
* Raise a sales request - why should this be part of support?
Primary Goal: help customers resolve their trouble tickets
- Log a support ticket
- Follow up on the same ticket
service nginx reload
nginx: [alert] could not open error log file: open() "/etc/nginx/logs/error.log" failed (13: Permission denied)
2013/07/05 14:59:24 [warn] 30019#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/conf/nginx.conf:1
nginx: the configuration file /etc/nginx/conf/nginx.conf syntax is ok
2013/07/05 14:59:24 [emerg] 30019#0: open() "/var/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/conf/nginx.conf test failed
@amite
amite / laravel deploy.sh
Created November 4, 2013 05:17
laravel deploy on digitalocean
#!/usr/bin/env bash
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time ---"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'