Skip to content

Instantly share code, notes, and snippets.

View vyuh's full-sized avatar

Prashant Karmakar vyuh

View GitHub Profile
(define hey (lambda () "the ultimate"))
(define pk (quote (special-forms "quote" "lambda" "define" "if" "set!")))
(define hey_pk (lambda (pk) (string-append "Hey " pk)))
(define mod_zed (lambda (x y) (+ (* x x) (* y y))))
(define test (lambda (x) (if x "yo" "no")))
; everything except #f is true
; in some implementations '() is equivalent to #f
; but do not use lists as predicates
; use null? to find empty lists
(define sum-gp
@vyuh
vyuh / setup_split_internet_access.sh
Created September 27, 2016 09:06
sets up internet traffic balancing over multiple interfaces
# sets up internet traffic balancing over multiple interfaces
# used on Lubuntu 16.04
# 2016-09-27 14:29 http://github.com/vyuh
#
# Read the webpage:
# http://lartc.org/howto/lartc.rpdb.multiple-links.html
# Change variables below to proper values,
# run this as root like `sudo bash +x <script_name>`
# `-x` aids debugging
#
@vyuh
vyuh / android_application_structure.clj
Created October 4, 2016 16:01
Stucture of an Android Application Project as a clojure map.
{:build.gradle {},
:gradle.properties {},
:settings.gradle {},
:local.properties {},
:modules
{:alib
{:build.gradle {},
:progaurd-rules.pro {},
:manifests {:AndroidManifest.xml {}},
:java {:androidTest {}, :test {}, :main {}},
@vyuh
vyuh / SQLITE_CLI_GARBLES_STRINGS.md
Last active November 18, 2016 15:25
Potential Bug Fix: Sqlite CLI removes CR characters in end of line even if they are inside quoted string literals.

BUG

SQLite CLI removes '\r' even from inside quoted strings that appear in SQL input piped into sqlite (CLI). These are never replaced later. A program should not tamper literals in this undocumented way.

DEMONSTRATION

Files in this repository face automatic CRLF translation

@vyuh
vyuh / install_heroku_without_sudo_linux.sh
Last active September 21, 2022 13:42
Install heroku without sudo on linux
#!/bin/sh
{
HEROKU_CLIENT_URL="https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz"
sh <<SCRIPT
# set appropriate HEROKU_DIR env variable
# default is ~/.local/heroku
# download and extract the client tarball
@vyuh
vyuh / build-elm-platform-on-freebsd-11-1.sh
Last active October 26, 2017 17:59
Trying to document how I built Elm Platform on FreeBSD 11.1
# make sure lzlib exists on system.
# run `pkg install lzlib`
# this is the only step that required superuser privileges.
# USAGE
# For building at <PREFIX>/Elm-Platform/<VERSION>, run:
# sh build-elm-platform-on-freebsd-11-1.sh <PREFIX> <VERSION>
# SIDE EFFECTS
# Blindly downloads ghc 7.10.2, keeps it beside Elm-Platform in <PREFIX>
@vyuh
vyuh / .fonts.conf
Last active November 11, 2017 06:58
Reject Bland fonts in Ubuntu
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<include ignore_missing="yes">/absolute/path/to/select.conf</include>
</fontconfig>
@vyuh
vyuh / typesetting_devnagari.xelatex
Created December 16, 2017 08:00
Typesetting Devnagari in XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}
\catcode`\~=12
\setlength\parindent{0pt}
\begin{document}
@vyuh
vyuh / cheatsheet_link.txt
Created December 17, 2017 06:56
Links to Cheatsheets
@vyuh
vyuh / fonts.conf
Created December 20, 2017 04:54
Fontconfig file for better firefox fonts on *NIX on websites like Github and Twitter
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Set preferred serif, sans serif, and monospace fonts. -->
<alias>
<family>serif</family>
<prefer><family>Droid Serif</family></prefer>
</alias>
<alias>
<family>sans-serif</family>