Skip to content

Instantly share code, notes, and snippets.

View dropocol's full-sized avatar
👋
Hello

Zeeshan Khan dropocol

👋
Hello
View GitHub Profile
@dropocol
dropocol / zsh & ohmyzsh on EC2 Amazon Linux AMI
Last active May 9, 2022 08:57 — forked from aaabramov/install.sh
Installing zsh + oh-my-zsh on Amazon EC2 Amazon Linux 2 AMI. (Prepared in the scope of posting https://aaabramov.medium.com/installing-zsh-oh-my-zsh-on-amazon-ec2-amazon-linux-2-ami-88b5fc83109)
sudo yum update
# Installing ZSH
sudo yum -y install zsh
# Check ZSH has been installed
zsh --version
# Install "util-linux-user" because "chsh" is not available by default
# See https://superuser.com/a/1389273/599050
# linux
UNISON_VERSION=2.48.4
sudo apt-get -y install inotify-tools ocaml-nox build-essential
curl -L https://github.com/bcpierce00/unison/archive/${UNISON_VERSION}.tar.gz | tar zxv -C /tmp
cd /tmp/unison-${UNISON_VERSION}
sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c
make UISTYLE=text NATIVE=true STATIC=true
cp src/unison src/unison-fsmonitor ~/bin
# You should modify your path to include ~/bin
### DigitalOcean Ubuntu 18.04 x64 + Rails 5 + Nginx + Unicorn + PostgreSQL9.6 + Capistrano 3
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
$ passwd
@dropocol
dropocol / mapOrder.js
Created December 29, 2017 18:44 — forked from ecarter/mapOrder.js
Order an array of objects based on another array order
/**
* Sort array of objects based on another array
*/
function mapOrder (array, order, key) {
array.sort( function (a, b) {
var A = a[key], B = b[key];
@dropocol
dropocol / test.js
Created May 22, 2017 18:53 — forked from jmyrland/test.js
Socket-io load test?
/**
* Modify the parts you need to get it working.
*/
var should = require('should');
var request = require('../node_modules/request');
var io = require('socket.io-client');
var serverUrl = 'http://localhost';
@dropocol
dropocol / Pop.swift
Created April 22, 2017 05:58 — forked from Daemon-Devarshi/Pop.swift
Push animation using custom segue
protocol Pop {
func moveBackToParentViewController(currentViewController: UIViewController)
}
extension Pop {
func moveBackToParentViewController(currentViewController: UIViewController) {
let transition = CATransition()
transition.duration = 0.5
transition.type = kCATransitionMoveIn