Skip to content

Instantly share code, notes, and snippets.

View mogetutu's full-sized avatar

Isaak Mogetutu mogetutu

View GitHub Profile
@mogetutu
mogetutu / digital_ocean_setup.md
Created June 15, 2016 02:35 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@mogetutu
mogetutu / install.md
Last active February 29, 2016 18:14 — forked from galulex/install.md
Ruby On Rails Ubuntu 14.04 install

Developer libs

mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...

sudo apt-get install libxslt1-dev libxml2-dev libmagickwand-dev imagemagick libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs nodejs-legacy rar libgmp-dev

Ruby

sudo apt-add-repository ppa:brightbox/ruby-ng

sudo apt-get update

@mogetutu
mogetutu / nvm.md
Last active February 24, 2016 06:55
Install NVM - Lastest Node & npm

Also, since nvm uses the name "node" instead of "nodejs", make sure that the unrelated program also named "node" -- the Amateur Packet Radio -- does not already exist on your system.

sudo apt-get install git build-essential libssl-dev curl git-core
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash

(I determined the latest nvm version available -- and a lot of other, really helpful information -- at: https://github.com/creationix/nvm)

@mogetutu
mogetutu / rspec_model_testing_template.rb
Created February 5, 2016 08:05 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@mogetutu
mogetutu / nginx-config-rails4-with-puma-ssl-version.conf
Created January 18, 2016 21:55 — forked from rkjha/nginx-config-rails4-with-puma-ssl-version.conf
Nginx config for rails 4 application using puma [ssl and non-ssl version]
upstream myapp_puma {
server unix:/tmp/myapp_puma.sock fail_timeout=0;
}
# for redirecting to https version of the site
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
}
@mogetutu
mogetutu / nginx.conf
Created December 24, 2015 16:25 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@mogetutu
mogetutu / .eslintrc
Created November 9, 2015 13:54 — forked from zackify/.eslintrc
Upgrade to Babel 6
{
"parser": "babel-eslint",
"env": {
"es6": true,
"mocha": true,
"node": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,

The format used to document the API is called API Blueprint – it's a standard for describing APIs. You can find the .apib files in docs/api/blueprint. Those files can be imported in Postman or Paw for faster testing, for Paw this requires the API Blueprint extension. It can also be imported into any service supporting the standard (Apiary, Dredd, etc.)

Via Dredd

To run the tests via Dredd first you need to generate the documentation as seen above. Once this is done, all you need to do is run grunt dredd:

$ node_modules/.bin/grunt dredd
@mogetutu
mogetutu / deploy.rb
Last active August 29, 2015 14:26 — forked from markoa/deploy.rb
Ingredients to monitor Resque with God automatically via Capistrano (on Ubuntu)
namespace :deploy do
desc "Hot-reload God configuration for the Resque worker"
task :reload_god_config do
sudo "god stop resque"
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}"
sudo "god start resque"
end
end
# append to the bottom: