Skip to content

Instantly share code, notes, and snippets.

View abdul's full-sized avatar
🎯
Focusing

Abdul Qabiz abdul

🎯
Focusing
View GitHub Profile
@abdul
abdul / music.md
Created October 19, 2018 10:35 — forked from staltz/music.md
coding music

Not for everyone. Each programmer has their own appreciation of what is good coding music.

For when I need to think deep, debug something, or design

(From most influential to least)

@abdul
abdul / get-npm-package-version
Created September 8, 2018 09:19 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
* {
margin: 0;
padding: 0;
@abdul
abdul / nginx.conf
Created May 9, 2018 18:59 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@abdul
abdul / ELK Procedure
Created May 9, 2018 18:46 — forked from sahilsk/ELK Procedure
nginx proxy configuration for elasticsearch
## Install Docker
```
# install the backported kernel
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@abdul
abdul / 1-easy.js
Created April 26, 2018 12:13 — forked from nybblr/1-easy.js
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {
@abdul
abdul / dnscrypt-blacklist.txt
Created April 20, 2018 04:07
macos - dnsmasq + dnssec + dnscrypt-proxy + privoxy configuration
###########################
# Blacklist #
###########################
## Rules for name-based query blocking, one per line
##
## Example of valid patterns:
##
## ads.* | matches anything with an "ads." prefix
@abdul
abdul / tree_extension_storage.js
Last active January 9, 2020 10:13
Firefox - Tree Style Tab Customization
{"requestingPermissions":null,"cachedExternalAddons":[],"notifiedFeaturesVersion":3,"style":"plain-dark","scrollbarMode":3,"userStyleRules":"/* Show title of unread tabs with red and italic font */\n/*\n.tab.unread .label {\n color: red !important;\n font-style: italic !important;\n}\n*/\n\n/* Add private browsing indicator per tab */\n/*\n.tab.private-browsing .label:before {\n content: \"🕶\";\n}\n*/\n/* Show title of unread tabs with red and italic font */\n\n/*.tab.unread .label { \ncolor: red !important; font-style: italic !important;}*/\n\n/* Add private browsing indicator per tab */\n/*.tab.private-browsing .label:before {content: \\\"🕶\\\";}*/\n\n/* Hide border on tab bar, force its state to 'scroll', adjust margin-left for width of scrollbar. */ \n\n#tabbar { border: 0; overflow-y: scroll !important; margin-left: -18px !important; }\n\n/* Hide .twisty and adjust margins so favicons have 7px on left. */\n\n.tab .twisty { visibility: hidden; /* margin-left: -2px; */}\n\n/* Push tab labels slightly
@abdul
abdul / user.action
Created April 11, 2018 13:11 — forked from sx2008/user.action
Privoxy User Action file
######################################################################
#
# File : $Source: /cvsroot/ijbswa/current/user.action,v $
#
# $Id: user.action,v 1.9 2008/03/27 18:27:37 fabiankeil Exp $
#
# Purpose : User-maintained actions file, see
# http://www.privoxy.org/user-manual/actions-file.html
#
######################################################################
@abdul
abdul / truffle-config.js
Created April 1, 2018 09:04 — forked from tomconte/truffle-config.js
Example Truffle 3.0 configuration file to allow deploying contracts to an Azure "Bletchley" Ethereum consortium network. Based on the Truffle docs for Infura (http://truffleframework.com/tutorials/using-infura-custom-provider).
var bip39 = require("bip39");
var ethwallet = require('ethereumjs-wallet');
var ProviderEngine = require("web3-provider-engine");
var WalletSubprovider = require('web3-provider-engine/subproviders/wallet.js');
var Web3Subprovider = require("web3-provider-engine/subproviders/web3.js");
var Web3 = require("web3");
// Insert raw hex private key here, e.g. using MyEtherWallet
var wallet = ethwallet.fromPrivateKey(Buffer.from('abcdef', 'hex'));