Skip to content

Instantly share code, notes, and snippets.

View zianwar's full-sized avatar

Anwar zianwar

View GitHub Profile
@zianwar
zianwar / .zshrc
Created September 14, 2014 13:45
.zhsrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# time that oh-my-zsh is loaded.
ZSH_THEME="awesomepanda"
# aliases for editing .zshrc file
alias zconf="nano ~/.zshrc"
alias sourcez="source ~/.zshrc"
alias ohmyzsh="nano ~/.oh-my-zsh"
@zianwar
zianwar / .bashrc
Last active August 29, 2015 14:27
bashrc
#!/usr/bin/env bash
# Path to the bash it configuration
export BASH_IT="$HOME/.bash_it"
# Lock and Load a custom theme file
# location /.bash_it/themes/
export BASH_IT_THEME='minimal'
# Don't check mail when opening terminal.
@zianwar
zianwar / install-server.sh
Last active August 29, 2015 14:27
Ubunutu server configuration
#!/bin/bash
# ========= SETTING UP A UNIX USER ===========
: <<'end_comment'
# Create a new unix user
adduser zianwar
# Add user to sudo group
gpasswd -a zianwar sudo
@zianwar
zianwar / download-website.sh
Created March 29, 2019 21:19 — forked from pete-otaqui/download-website.sh
download a website for offline browsing with wget
#!/bin/bash
wget -E -k -r -p -e robots=off https://some-site.com/docs/
#### Note the following arguments:
# -E : converts downloaded HTML filenames to have a ".html" suffix
# -k : converts internal links within downloaded files to point to other downloaded files
# -r : recursively download by scanning for internal links in pages
# -p : download "page requisites", i.e. images, styles, scripts
# -e robots=off : ignore robots.txt (because some sites use it to avoid indexing)
@zianwar
zianwar / plaid_transaction_categories.txt
Last active April 4, 2025 06:57
Plaid transactions categories list, more info: http://plaid.com/docs/#categories
Bank Fees
Bank Fees Overdraft
Bank Fees ATM
Bank Fees Late Payment
Bank Fees Fraud Dispute
Bank Fees Foreign Transaction
Bank Fees Wire Transfer
Bank Fees Insufficient Funds
Bank Fees Cash Advance
Bank Fees Excess Activity
@zianwar
zianwar / channel_manager_server.go
Last active February 3, 2020 18:49
Channel manager server golang
// Source: https://github.com/eliben/code-for-blog/blob/master/2019/gohttpconcurrency/channel-manager-server.go
//
// This version of the server protects all shared data within a manager
// goroutine that accepts commands using a channel.
//
// Eli Bendersky [http://eli.thegreenplace.net]
// This code is in the public domain.
package main
import (
@zianwar
zianwar / json_syntaxerror.go
Last active October 29, 2021 10:19
Golang JSON Syntax error handling
package main
import (
"encoding/json"
"fmt"
"log"
)
type SyntaxError struct {
*json.SyntaxError
@zianwar
zianwar / fanin.go
Last active June 11, 2019 17:33
Golang Fan-in concurrency pattern.
func fanIn(chans ...<-chan int) chan int {
var wg sync.WaitGroup
c := make(chan int)
// Closure to send values from a channel
output := func(ch <-chan int) {
for n := range ch {
c <- n
@zianwar
zianwar / splitcsv.sh
Last active September 4, 2020 01:35
Split CSV file into multiple files by specifying how many lines in each split.
#!/bin/bash
# This script uses the GNU split utility: http://man7.org/linux/man-pages/man1/split.1.html.
# You can use it as a bash script or copy the `splitcsv` function into your own bash/zsh... profile.
function splitcsv {
if [ "$#" -ne 2 ]; then
printf "Usage:\n\n splitcsv [filename] [lines] \n"
return 1
fi
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files