Skip to content

Instantly share code, notes, and snippets.

View marz619's full-sized avatar
🌎
Working From Earth

Ammaar Esmailjee marz619

🌎
Working From Earth
View GitHub Profile
@marz619
marz619 / json_io.go
Last active April 26, 2017 17:52
simple JSON utility funcs
package json
import (
"bytes"
"encoding/json"
"io"
)
// WriteJSON tries to encode `data` in to the provided io.Writer
//
@marz619
marz619 / threadpool.py
Last active February 23, 2018 12:13
A simple ThreadPool example in python
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import time
from multiprocessing import cpu_count
from multiprocessing.pool import ThreadPool
import requests
@marz619
marz619 / rotate_slice.go
Created December 23, 2016 21:09
Rotate a slice
package aoc
import (
"errors"
"reflect"
)
// rotate rotates the values of a slice by rotate positions, preserving the
// rotated values by wrapping them around the slice
func rotate(slice interface{}, rotate int) error {
@marz619
marz619 / update_git.sh
Last active November 4, 2015 02:49
Scripts for refreshing git projects
#!/bin bash
# single depth folder
for d in `ls -d *(^@)`; do
echo $d
cd $d
branch=`git rev-parse --abbrev-ref HEAD`
echo "branch=$branch"
if [ "$branch" = "master" ]; then
echo "$d - master"
@marz619
marz619 / redis_rename_keys.sh
Last active January 7, 2023 08:14
Rename Redis Keys
#!/bin/bash
# args
host=$1
shift
prefix=$1
shift
# from=$1
# shift
# to=$1
@marz619
marz619 / keybase.md
Created October 1, 2014 17:55
keybase.md

Keybase proof

I hereby claim:

  • I am marz619 on github.
  • I am ammaar (https://keybase.io/ammaar) on keybase.
  • I have a public key whose fingerprint is 3639 9955 5DB2 0D2E F4E8 E7F3 F2A1 6018 035F 7A86

To claim this, I am signing this object: