Skip to content

Instantly share code, notes, and snippets.

@indraniel
indraniel / 1_google_cloud_storage_backup_tutorial.md
Created Sep 8, 2018 — forked from rnwolf/1_google_cloud_storage_backup_tutorial.md
Tutorial shows how to make backups to Google Cloud Storage.
View 1_google_cloud_storage_backup_tutorial.md

Google Cloud Storage backup tutorial

Introduction

This tutorial shows how to make backups to Google Cloud Storage. The backups are:

  • automatic
  • stored off site
  • incremental
@indraniel
indraniel / chromecast-scheduler.py
Created Dec 29, 2017
Example sending a list of local videos to chromecast
View chromecast-scheduler.py
#!/usr/bin/env python
# Based on: https://github.com/piedar/pychromecast/blob/cast/cast.py
# https://github.com/balloob/pychromecast/issues/8
# https://github.com/balloob/pychromecast/issues/154
# https://en.wikipedia.org/wiki/Multicast_DNS
# Copyright 2015 Benn Snyder <benn.snyder@gmail.com>
# Released under MIT license
#
@indraniel
indraniel / gcp-price-list.json
Created Jun 13, 2018
Old style google cloud platform (GCP) JSON price list . Modern times now use the GCP billing API
View gcp-price-list.json
{
"comment": "If you've gotten here by mistake, this is the JSON data used by our pricing calculator. It is helpful for developers. Go to https://cloud.google.com/products/calculator/ to get back to our web calculator.",
"version": "v1.13",
"updated": "01-August-2017",
"gcp_price_list": {
"sustained_use_base": 0.25,
"sustained_use_tiers": {
"0.25": 1.0,
"0.50": 0.8,
"0.75": 0.6,
@indraniel
indraniel / Makefile
Last active May 19, 2020
A template to start a common-lisp project inside a separate "virtual environment"
View Makefile
.PHONY: init-project repl deps
#https://stackoverflow.com/a/23324703 (gets the absolute directory of the Makefile)
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
QUICKLISP_DIR := $(ROOT_DIR)/quicklisp
UTILS_DIR := $(QUICKLISP_DIR)/utils
SBCL := $(HOME)/sw/cl/sbcl/2.0.3/bin/sbcl
SWANK_HOST := "127.0.0.1"
@indraniel
indraniel / 1-make-patches.sh
Created May 1, 2020
technique to transfer commits from one git repository to another different git repository
View 1-make-patches.sh
#!/bin/bash
# select the relevant commits i would like to take from source git repoA
mkdir -p patches
git format-patch -1 --stdout 8adb447ccbfd88bf57a571105f6af3b000f343c5 >patches/1.patch
git format-patch -1 --stdout 8f71637c2e407aa8d9e040b1f8168cd5bc9590a4 >patches/2.patch
git format-patch -1 --stdout 968ac4b5e74abf26cf3e53c6f2a1722e8ab62de3 >patches/3.patch
git format-patch -1 --stdout d7c13e31b502049c436d898b037729d08b6078a0 >patches/4.patch
git format-patch -1 --stdout e00ddb86adebb2d528a08abd91bfd7237d32a07e >patches/5.patch
@indraniel
indraniel / toy-bleve-goleveldb-test.go
Last active Jan 22, 2020
A test bleve program that uses goleveldb as its backend storage
View toy-bleve-goleveldb-test.go
package main
// goleveldb test
// mentioned in bleve google group
// https://groups.google.com/forum/#!topic/bleve/aHZ8gmihLiY
//
// Based on an earlier toy program using bleve defaults (including BoltDB):
// https://gist.github.com/indraniel/8108bd7def9b5e222417
import (
@indraniel
indraniel / gh-pages.md
Created Dec 17, 2019 — forked from ramnathv/gh-pages.md
Creating a clean gh-pages branch
View gh-pages.md

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@indraniel
indraniel / gnuplot-py-example.py
Created Apr 22, 2019 — forked from drmalex07/gnuplot-py-example.py
A simple example for Gnuplot.py. #python #gnuplot
View gnuplot-py-example.py
import numpy
import Gnuplot
def rainfall_intensity_t10(t):
return 11.23 * (t**(-0.713))
def rainfall_intensity_t50(t):
return 18.06 * (t**(-0.713))
g = Gnuplot.Gnuplot()
@indraniel
indraniel / 00_destructuring.md
Created Jan 26, 2019 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet
View 00_destructuring.md

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences