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 / redis_rename_keys.sh
Last active October 22, 2025 22:44
Rename Redis Keys
#!/bin/bash
# args
prefix=$1
replace=$2
redis='redis-cli -s /var/run/redis/redis.sock'
keys=( $(redis-cli -h $host KEYS "$prefix*") )
for key in "${keys[@]}"
@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: