Skip to content

Instantly share code, notes, and snippets.

View shopglobal's full-sized avatar
💻
deploying Electronero 2.0

⛓️INTERCHAINED ⚡Electronero Network ʕ•̫͡•ʔ-̫͡-ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ-̫͡-ʔ shopglobal

💻
deploying Electronero 2.0
View GitHub Profile
@shopglobal
shopglobal / index.html
Created November 11, 2017 07:13
Sequelize CRUD 102
<main role="main">
<article class="post tag-node-js tag-express-js tag-sequelize tag-api tag-javascript article_purus">
<header class="postheader_purus no-cover">
<div class="vertical_purus">
<div class="inner_purus">
<h1 class="posttitle_purus">Sequelize CRUD 102</h1>
<ul>
<li><time class="date_purus"> Oct 16 2016</time></li>
</ul>
</div>
AME
git-worktree - Manage multiple working trees
SYNOPSIS
git worktree add [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<branch>]
git worktree list [--porcelain]
git worktree lock [--reason <string>] <worktree>
git worktree prune [-n] [-v] [--expire <expire>]
git worktree unlock <worktree>
DESCRIPTION
@shopglobal
shopglobal / gist:c98b13a1b496c6b30b64869084bf8789
Created November 3, 2017 21:23
How To Use Git Hooks To Automate Development and Deployment Tasks
Introduction
Version control has become a central requirement for modern software development. It allows projects to safely track changes and enable reversions, integrity checking, and collaboration among other benefits. The git version control system, in particular, has seen wide adoption in recent years due to its decentralized architecture and the speed at which it can make and transfer changes between parties.
While the git suite of tools offers many well-implemented features, one of the most useful characteristics is its flexibility. Through the use of a "hooks" system, git allows developers and administrators to extend functionality by specifying scripts that git will call based on different events and actions.
In this guide, we will explore the idea of git hooks and demonstrate how to implement code that can assist you in automating tasks in your own unique environment. We will be using an Ubuntu 14.04 server in this guide, but any system that can run git should work in a similar way.
Prerequisites
@shopglobal
shopglobal / gist:344925d5798cc4784c998bef3a799e31
Last active November 3, 2017 21:28
Pushing your local Git repository to a Remote server — Linux & Mac OS X
Pushing from Linux or Mac OS X
On your local computer, navigate to your user's ~/.ssh directory:
[local ~]$ cd ~/.ssh
If the directory doesn't exist, create it:
[local ~]$ mkdir ~/.ssh
Set up SSH keys by running the following command:
[local ~]$ ssh-keygen -t rsa -b 4096 -C "Remote Server Git repo"
Enter a name for the file when prompted, such as 'Remote-git-key'.
When prompted to enter a password, click 'Enter' twice to skip.
Two new files are created in your user's .ssh directory:
@shopglobal
shopglobal / gist:e772ed397da04318583a3abcc1202257
Created November 3, 2017 21:21
How To Use Git Hooks To Automate Development and Deployment Tasks
Introduction
Version control has become a central requirement for modern software development. It allows projects to safely track changes and enable reversions, integrity checking, and collaboration among other benefits. The git version control system, in particular, has seen wide adoption in recent years due to its decentralized architecture and the speed at which it can make and transfer changes between parties.
While the git suite of tools offers many well-implemented features, one of the most useful characteristics is its flexibility. Through the use of a "hooks" system, git allows developers and administrators to extend functionality by specifying scripts that git will call based on different events and actions.
In this guide, we will explore the idea of git hooks and demonstrate how to implement code that can assist you in automating tasks in your own unique environment. We will be using an Ubuntu 14.04 server in this guide, but any system that can run git should work in a similar way.
Prerequisites
@shopglobal
shopglobal / gist:2cbffb5d278bd56e985b4263cc5b367a
Created November 3, 2017 21:20
How To Set Up Automatic Deployment with Git with a VPS
Introduction
For an introduction to Git and how to install, please refer to the introduction tutorial.
This article will teach you how to use Git when you want to deploy your application. While there are many ways to use Git to deploy our application, this tutorial will focus on the one that is most straightforward. I assume you already know how to create and use a repository on your local machine. If not, please refer to this tutorial.
When you use Git, the workflow generally is toward version control only. You have a local repository where you work and a remote repository where you keep everything in sync and can work with a team and different machines. But you can also use Git to move your application to production.
Server Setup
Our fictitious workspace:
@shopglobal
shopglobal / gist:75870369efd042031f67e98976892850
Created November 3, 2017 21:20
How To Set Up Automatic Deployment with Git with a VPS
Introduction
For an introduction to Git and how to install, please refer to the introduction tutorial.
This article will teach you how to use Git when you want to deploy your application. While there are many ways to use Git to deploy our application, this tutorial will focus on the one that is most straightforward. I assume you already know how to create and use a repository on your local machine. If not, please refer to this tutorial.
When you use Git, the workflow generally is toward version control only. You have a local repository where you work and a remote repository where you keep everything in sync and can work with a team and different machines. But you can also use Git to move your application to production.
Server Setup
Our fictitious workspace:
@shopglobal
shopglobal / post-receive
Created November 3, 2017 21:18 — forked from sergeylukin/post-receive
Git hook (post-receive): update working tree on PUSH
#!/bin/sh
#
# This hook is placed in Bare repository and it updates Working tree whenever a PUSH
# is executed
#
# Assuming following file structure:
# .
# |-- myproject
# |-- myproject.git
# set WORKTREE=../myproject
@shopglobal
shopglobal / udemy-course.sh
Created November 3, 2017 21:17 — forked from bahdcoder/udemy-course.sh
Installation of Laravel on Ubuntu 16 server
#
# Requirements:
# - Ubuntu server
# - Root password for ubuntu server
# ssh into the server from local computer
ssh root@{server_name or server_ip_address}
#Updating ubuntu base packages
@shopglobal
shopglobal / load-hbs-partials.js
Created October 31, 2017 04:44 — forked from benw/load-hbs-partials.js
Loads partial handlebars templates from files in a directory
// Helps with this problem:
// http://stackoverflow.com/questions/8059914/express-js-hbs-module-register-partials-from-hbs-file
var hbs = require('hbs');
var fs = require('fs');
var partialsDir = __dirname + '/../views/partials';
var filenames = fs.readdirSync(partialsDir);