Skip to content

Instantly share code, notes, and snippets.

View indykish's full-sized avatar

Kishorekumar Neelamegam indykish

View GitHub Profile
@indykish
indykish / libpostal_install.sh
Last active August 24, 2022 06:48 — forked from albarrentine/libpostal_install.sh
libpostal installation
# Pre-requisites: steps provided for Mac and Debian/Ubuntu
# 1. Install autotools if you don't have it already
# Mac: brew install autoconf automake libtool
# Ubuntu: apt-get install autotools-dev
# 2. Install snappy
# Mac: brew install snappy
# Ubuntu: apt-get install libsnappy-dev)
# For Ubuntu only
apt-get install autotools-dev
@indykish
indykish / playground.rs
Created September 10, 2020 18:55 — forked from anonymous/playground.rs
Rust code shared from the playground
mod db_schema{ // diesel generated schema
pub mod period {
pub struct table {}
pub struct tenant_id {}
}
pub mod category {
pub struct table {}
pub struct id {}
}
@indykish
indykish / whiteboardCleaner.md
Created May 21, 2020 11:59 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@indykish
indykish / playground.rs
Created December 31, 2019 06:22 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use chrono::prelude::*;
use regex::Regex;
#[macro_use]
extern crate lazy_static; // 1.4.0
/// A function when provided with the date in the format
/// YYYY/MM/DD or YYYY-MM-DD returns an output as YYYYMMDD
/// If the date is invalid it returns the today (now) YYYYMMDD
/// Hmm, I think its best to send back as none.
pub fn date_in_cobol_format(text: &str) -> Option<String> {
@indykish
indykish / playground.rs
Created December 31, 2019 06:22 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![allow(unused)]
trait Foo {
fn bar(&self);
fn baz(&self);
}
struct MyStruct;
impl Foo for MyStruct {
fn bar(&self) {
let mut d = vec!["a", "b", "c", "d","e","f","g","h", "i", "l", "m"];
@indykish
indykish / bootstrap
Created November 10, 2019 13:38 — forked from mhart/bootstrap
Out-of-the-box AWS Lambda custom runtime (implemented in bash!)
#!/bin/sh
set -euo pipefail
# Handler format: <script_name>.<function_name>
# The script file <script_name>.sh must be located in
# the same directory as the bootstrap executable.
source $(dirname "$0")/"$(echo $_HANDLER | cut -d. -f1).sh"
while true
@indykish
indykish / riak.service
Last active April 15, 2019 10:20
Archlinux riak systemd service with ulimit fix
#Checkout for a free launch at, https://www.megam.io
[Unit]
Description=Distributed key/value store from Basho Technologies
After=network.target
[Service]
LimitNOFILE=infinity
LimitMEMLOCK=infinity
User=riak
Type=forking
@indykish
indykish / dockerinstall_xenial.sh
Last active July 31, 2018 04:43 — forked from katopz/install-docker-exp.sh
Install Docker 1.12 on Ubuntu Xenial 16.04.1 x64
# Install Docker on Xenial 16.04.1 x64
# Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/
# No interactive for now.
export DEBIAN_FRONTEND=noninteractive
# Update your APT package index.
sudo apt-get -y update
# Update package information, ensure that APT works with the https method, and that CA certificates are installed.
sudo apt-get -y install apt-transport-https ca-certificates
# Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@indykish
indykish / clone_fn_rust.rs
Created December 29, 2017 10:45
Clone Fn closure using Arc in rust lang
use std::sync::Arc;
use std::fmt;
type Fp = Box<Fn(i8, i8) -> i8 + Send + Sync>;
#[derive(Clone)]
struct WithCall {
fp: Arc<Fp>,
}
@indykish
indykish / monkey.post
Created April 28, 2017 05:59
Mocky.io: POST of monkey with id: 1
{
"id": "1",
"name": "fegh",
"items": [
{
"key": "food",
"value": "banana"
},
{
"key": "work",