Skip to content

Instantly share code, notes, and snippets.

View lshaf's full-sized avatar
💭
Working

L Shaf lshaf

💭
Working
View GitHub Profile
@lshaf
lshaf / gist:ccb68322b5d118085b0193414869f223
Created September 10, 2019 04:33 — forked from bkrauska/gist:9742260
DiffMerge git mergetool & difftool setup
Install http://download-us.sourcegear.com/DiffMerge/4.2.0/DiffMerge_4.2.0.697.stable_x64.msi
// this is an adaptation of http://adventuresincoding.com/2010/04/how-to-setup-git-to-use-diffmerge
Then run the following commands from the git bash
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd "sgdm --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE"
@lshaf
lshaf / gunicorn.init.d
Last active February 23, 2021 01:48 — forked from leplatrem/yourapp
gunicorn virtualenv init.d script (could be simpler with upstart)
#! /bin/bash
### BEGIN INIT INFO
# Provides: yourapp
# Required-Start: nginx
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The main django process
# Description: The gunicorn process that receives HTTP requests
# from nginx
@lshaf
lshaf / do_notification.user.js
Last active July 12, 2019 14:58
to read all
// ==UserScript==
// @name Digital Ocean Notification Reader
// @namespace https://gist.github.com/lshaf
// @version 1.0.2
// @description try to take over the world!
// @author L Shaf
// @match https://cloud.digitalocean.com/notifications*
// @run-at document-end
// @grant none
// @downloadURL https://gist.github.com/lshaf/3f0ff89d97c296a2e53b2e5a4b1e6573/raw/924299546536a4febab8c2628697668aa6863ed2/do_notification.user.js
// ==UserScript==
// @name Anime Series Downloader
// @namespace https://gist.github.com/lshaf
// @version 1.0.1
// @description try to take over the world!
// @author L Shaf
// @match http*://animeseries.io/watch/*
// @match http*://*.animeseries.io/watch/*
// @run-at document-end
// @grant none
@lshaf
lshaf / termux.md
Created April 30, 2019 10:48
Best setting for termux
@lshaf
lshaf / dnscrypt.md
Created December 28, 2018 04:21 — forked from pengelana/dnscrypt.md
dnscrypt
/**
WHAT IS THIS?
- This is script to do auto click unfollow button on instagram
HOW TO USE IT?
- Open your profile after logged in
- Open following tab
- Scroll following window until the bottom (optional)
- Run code below on DevTool Console
@lshaf
lshaf / idToChar.js
Created May 8, 2018 06:47
Converting numeric id to character id
function idToChar(id) {
const alpha = "1234567890abcdefghijklmnopqrstuvwxyz-_";
var tempId = id;
var shortCode = "";
while (tempId > 0) {
var mod = tempId % alpha.length;
tempId = Math.floor(tempId / alpha.length);
shortCode = `${alpha.charAt(mod)}${shortCode}`;
}
@lshaf
lshaf / overlap_test.php
Created February 19, 2016 13:42
Script to test date range overlap
<?php
echo '<pre>';
$sDate = '2016-02-03';
$eDate = '2016-02-10';
$overlapTest = [
# start before sDate
['2016-02-01', '2016-02-03'],
['2016-02-01', '2016-02-02'],
['2016-02-01', '2016-02-09'],
['2016-02-01', '2016-02-11'],

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies