Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Programming

Interchained shopglobal

💭
Programming
View GitHub Profile
@shopglobal
shopglobal / gist:344925d5798cc4784c998bef3a799e31
Last active Nov 3, 2017
Pushing your local Git repository to a Remote server — Linux & Mac OS X
View gist:344925d5798cc4784c998bef3a799e31
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: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
@shopglobal
shopglobal / index.html
Created Nov 11, 2017
Sequelize CRUD 102
View index.html
<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>
@shopglobal
shopglobal / how-to-install-latest-gcc-on-ubuntu-lts.txt How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
View how-to-install-latest-gcc-on-ubuntu-lts.txt
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
View gist:9f9fe38179e94b545a65f034965b480c
I make those changes in the original code:
https://github.com/pmitchev/testcoin/commit/bde47c6b7c575ab04aee43cc372ff1ebd3306d7a
I buy blank Ubuntu 14.04 VPS (2 GB RAM) (32GB on compile time)
I install dependencies:
wget https://raw.githubusercontent.com/forknote/cryptonote-generator/master/configure.sh
bash configure.sh
Clone and compile:
git clone https://github.com/pmitchev/testcoin/
cd testcoin
mkdir -p build/release; cd build/release
@shopglobal
shopglobal / cryptocurrency-converter.js
Created Dec 15, 2017
Google Sheets Cryptocurrency Converter Script
View cryptocurrency-converter.js
function performLookups() {
convertCrypto('BTC', 'USD', 2, 3);
convertCrypto('LTC', 'USD', 3, 3);
convertCrypto('ETH', 'USD', 4, 3);
}
function convertCrypto(symbol, currency, row, column) {
var url = 'https://min-api.cryptocompare.com/data/price?fsym=' + symbol + '&tsyms=' + currency;
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
@shopglobal
shopglobal / get-current-crypto-prices.js
Created Dec 15, 2017 — forked from gmcdev/get-current-crypto-prices.js
Map current cryptocurrency prices into Google Sheets
View get-current-crypto-prices.js
/* USAGE:
* Sheet -> Tools -> Script Editor...
* Paste this script
* Update the map (below) to your preferences
* Create a button in your Sheet and Assign Script: `test`
* et voila profit
*/
function test() {
// maps currencies.tokens to sheet ranges
getPrices({
@shopglobal
shopglobal / selenium
Created Dec 21, 2017 — forked from adeubank/selenium
Set up selenium on Ubuntu 16.04 as a service
View selenium
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium.pid
then
echo "Selenium is already running."
else
export DISPLAY=localhost:99.0
java -Dwebdriver.gecko.driver="/usr/lib/geckodriver/geckodriver" -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid
View ExportSlackHistory.php
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//