Skip to content

Instantly share code, notes, and snippets.

View jancarloviray's full-sized avatar

JC jancarloviray

  • Florida
View GitHub Profile
@jancarloviray
jancarloviray / .babelrc.js
Created June 28, 2019 10:05 — forked from nodkz/.babelrc.js
Babel 7.0 with .babelrc.js
/* eslint-disable prefer-template */
const path = require('path');
const aliases = require('./aliases');
// ///////////////////////////////////////////////////////////////
// ////////////////// PLUGINS ////////////////////////////////
// ///////////////////////////////////////////////////////////////
const commonPlugins = [
@jancarloviray
jancarloviray / digitalocean.md
Created January 30, 2017 18:34 — forked from stevenchanin/digitalocean.md
Setup instructions for Digital Ocean VPS using Ubuntu and Rails 3.2 #digitalocean #vps #setup

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create Droplet

Create droplet of your liking (ubuntu 12.04 x32) Use an xx.04 LTS version

Setup DNS

On Digital Ocean, create a DNS entry for your server (xyz.com)

Make sure it has NS records that use digital oceans nameservers

@jancarloviray
jancarloviray / exercise.tour.go
Created January 27, 2017 02:05 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@jancarloviray
jancarloviray / nginx.conf
Created January 23, 2017 02:25 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
@jancarloviray
jancarloviray / kubernetes_on_macOS.md
Created January 17, 2017 19:06 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@jancarloviray
jancarloviray / (README).md
Created December 29, 2016 20:18 — forked from xiongjia/(README).md
A simple Bookshelfjs sample

A simple Bookshelfjs sample

Bookshelfjs ( http://bookshelfjs.org/ ) is a javascript ORM for Node.js This gist is a simple bookshelfjs sample.

Installation

  1. Clone this gist to a local folder
  2. Run npm run build in the local folder

Configuration

  • This sample read the database config from config.js.
@jancarloviray
jancarloviray / count.js
Created December 29, 2016 20:14 — forked from jordaaash/count.js
Bookshelf.js/Knex.js innerJoin withRelated
var Promise = require('bluebird'),
User = require('./user'),
knex, query;
knex = User.prototype._builder(User.prototype.tableName);
query = function (q) {
q.distinct()
.innerJoin('orders', function () {
this.on('users.id', '=', 'orders.user_id')
@jancarloviray
jancarloviray / (README).md
Created December 23, 2016 20:32 — forked from xiongjia/(README).md
A simple knex sample

A simple knex sample

knexjs ( http://knexjs.org/ ) is SQL query builder.
This gist is a simple knexjs sample.

Installation

  1. Clone this gist to a local folder
  2. Run npm run build in the local folder

Usage & Database Schema

  • node index.js --createSchema : Create the database schema. (The default SQL client is sqlite3. The schema is created by db_schema.js )