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 / 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",
@indykish
indykish / Readme_VSCODE_FreeBSD
Created November 19, 2016 17:39 — forked from prash-wghats/Readme_VSCODE_FreeBSD
Notes for Building Electron and VSCode in FreeBSD11
Copy all the files to the build directory.
Copy icudtl.dat to the build directory. (you can find it in the vscode downloads ex for linux).
chromium version in port is 52.0.2743.116.
This was built with FreeBSD 11.0-RELEASE-p1. If building with other versions probably need to change
the freebsd versions in diff files (ex. freebsd11 => freebsd10)
Installed
node => v6.9.1
npm => 3.9.2
>chmod 755 vscode_build.sh
@indykish
indykish / nil.sh
Last active September 27, 2016 04:44
Nilavu production tuneup
### Base image prepare
apt-get -y update
apt-get -y install build-essential git wget \
libxslt-dev libcurl4-openssl-dev \
libssl-dev libyaml-dev libtool \
libxml2-dev gawk parallel \
libreadline-dev \
language-pack-en cron anacron \
psmisc rsyslog whois brotli