Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Programming

Interchained shopglobal

💭
Programming
View GitHub Profile
@shopglobal
shopglobal / scopes.txt
Created Aug 6, 2017 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
View scopes.txt
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 Sep 22, 2017 — forked from yairEO/jQuery.ajaxRetry.js
jQuery AJAX smart retry
View jQuery.ajaxRetry.js
// 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)
View clone-all-twitter-github-repos.sh
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 Oct 31, 2017 — forked from benw/load-hbs-partials.js
Loads partial handlebars templates from files in a directory
View load-hbs-partials.js
// 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 Nov 3, 2017 — forked from bahdcoder/udemy-course.sh
Installation of Laravel on Ubuntu 16 server
View udemy-course.sh
#
# 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 Nov 3, 2017 — forked from sergeylukin/post-receive
Git hook (post-receive): update working tree on PUSH
View post-receive
#!/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:2cbffb5d278bd56e985b4263cc5b367a
Created Nov 3, 2017
How To Set Up Automatic Deployment with Git with a VPS
View gist:2cbffb5d278bd56e985b4263cc5b367a
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 Nov 3, 2017
How To Use Git Hooks To Automate Development and Deployment Tasks
View gist:e772ed397da04318583a3abcc1202257
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:c98b13a1b496c6b30b64869084bf8789
Created Nov 3, 2017
How To Use Git Hooks To Automate Development and Deployment Tasks
View gist:c98b13a1b496c6b30b64869084bf8789
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
View gist:df0dd88325e9f5ec19f1ceb01e8156f8
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