Skip to content

Instantly share code, notes, and snippets.

@kmassada
kmassada / Capistrano-Deployment-Recipe.rb
Created November 10, 2015 13:28 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@kmassada
kmassada / README.md
Last active September 10, 2021 08:29 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-available directory.
mkdir -p /usr/local/etc/nginx/sites-available

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default and default-ssl to /usr/local/etc/nginx/sites-available
    #STOP APACHE
    sudo apachectl stop
@kmassada
kmassada / phantomTest.js
Created October 28, 2015 10:17
Take screenshot using phantomJS (Headless Browser)
var page = require('webpage').create();
page.open('http://net.tutsplus.com', function () {
var title = page.evaluate(function () {
var posts = document.getElementsByClassName("post");
posts[0].style.backgroundColor = "#000000";
return document.title;
});
page.clipRect = { top: 0, left: 0, width: 600, height: 700 };
page.render(title + ".png");
angular
.module('storageModule', [])
.factory('store',['$window', function($window){
return {
setLocal: function( key, value ){
try{
if( $window.Storage ){
$window.localStorage.setItem(key, value);
return true;
} else {
@kmassada
kmassada / gulpfile-basic-laravel.js
Created September 9, 2015 15:10
gulpfile-basic-laravel.js
/*
|----------------------------------------------------------------
| Have a Drink!
|----------------------------------------------------------------
|
*/
// --- INIT
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'), // compiles sass to CSS
@kmassada
kmassada / Homestead.yml
Created September 7, 2015 15:02
Homestead config
---
ip: "192.168.33.11"
memory: 2048
cpus: 1
hostname: laravel5-dev
name: laravel5-dev
provider: virtualbox
authorize: .homestead/[email protected]
@kmassada
kmassada / centons7-elasticsearch-install
Last active August 29, 2015 14:23
installing elastic search centos7
#!/usr/bin/env bash
echo ">>> Installing Elasticsearch"
cd /opt
sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u40-b25/jre-8u40-linux-x64.tar.gz"
sudo tar xvf jre-8*.tar.gz
@kmassada
kmassada / centos7-lamp-bootstrap
Last active March 7, 2018 21:02
centos7 LAMP bootstrap [vagrant]
#!/usr/bin/env bash
# centos7-mamp-bootstrap.sh
# this is an end to end LAMP setup on Centos7.
# this was originally written for Bootsrap.sh on Vagrant
#DATABASE_PW: root password to you db
DATABASE_PW=''
#DOMAIN: name of domain, used for ServerName in Apache
@kmassada
kmassada / mongo-user-setup
Last active August 29, 2015 14:21 — forked from tamoyal/gist:10441108
Mongo User setup
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@kmassada
kmassada / sql-create-db-user
Created April 15, 2015 14:47
Create sql database and user
SITE="laravel"
USER="dev"
cat >> $SITE-setup.sql << EOF
CREATE DATABASE ${SITE};
GRANT ALL PRIVILEGES ON ${SITE}.* TO '${USER}'@'localhost' identified by '';
FLUSH PRIVILEGES;
EOF
mysql -u root -p < $SITE-setup.sql