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 / scopes.txt
Created August 6, 2017 21:06 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@shopglobal
shopglobal / jQuery.ajaxRetry.js
Created September 22, 2017 22:53 — forked from yairEO/jQuery.ajaxRetry.js
jQuery AJAX smart retry
// enhance the original "$.ajax" with a retry mechanism
$.ajax = (($oldAjax) => {
// on fail, retry by creating a new Ajax deferred
function check(a,b,c){
var shouldRetry = b != 'success' && b != 'parsererror';
if( shouldRetry && --this.retries > 0 )
setTimeout(() => { $.ajax(this) }, this.retryInterval || 100);
}
return settings => $oldAjax(settings).always(check)
@shopglobal
shopglobal / spotify.js
Created October 2, 2017 07:23 — forked from daniel-j/spotify.js
A simple node.js program to listen to Spotify tracks, albums and playlists
#!/usr/bin/env node
'use strict';
/*
This is a simple Spotify cli-based client with optional Icecast2/shout support!
It should work for non-premium users, but you must connect your Spotify account to Facebook.
Usage:
$ node spotify <spotify uris> <playlist uri> <album uri> <track uri> <etc...>
@shopglobal
shopglobal / clone-all-twitter-github-repos.sh
Created October 5, 2017 00:37 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@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);
@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 / 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 / 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 / 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: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