Skip to content

Instantly share code, notes, and snippets.

Prashant Karmakar vyuh

Block or report user

Report or block vyuh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vyuh
vyuh / data-walk-email-bug-report.txt
Last active May 14, 2018
Data::Walk Bug Report and Patch
View data-walk-email-bug-report.txt
Subject: Top Level Object should not have a container
Data::Walk Version 2.01 assigns `container` and `type` for top-level objects
in an inconsistent way. On one hand, A scalar at top level gets the
arrayref of `@args` as `container`, and `ARRAY` as `type`. Whereas
a hashref, or arrayref, at top-level gets *ITSELF* as the `container`,
and its own ref type (`ARRAY|HASH`) as `type`. The latter behaviour
is not consistent because it implies that the item is contained in
itself.
@vyuh
vyuh / trymathwords.tex
Created Jan 4, 2018
A nice plain tex macro for tryin control sequences in math mode.
View trymathwords.tex
\magnification=1200
\def\endmathwords{$$}
\def\trymathwords#1{%
$$
\begingroup
\edef\@tempa{#1\space}%
\expandafter\endgroup
\expandafter\readwords\@tempa\relax
}
\def\readwords#1 #2\relax{%
@vyuh
vyuh / cogeo.pl
Created Dec 22, 2017
Coordinate Geometry Functions
View cogeo.pl
use List::Util qw/sum0 pairmap/;
sub zip2 {
@_[ map { $_, $_ + @_ / 2 } 0 .. ( @_ / 2 - 1 ) ];
}
sub zip3 {
@_[ map { $_, $_ + @_ / 3, $_ + 2 * ( @_ / 3 ) } 0 .. ( @_ / 3 - 1 ) ];
}
@vyuh
vyuh / fonts.conf
Created Dec 20, 2017
Fontconfig file for better firefox fonts on *NIX on websites like Github and Twitter
View fonts.conf
<?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>
@vyuh
vyuh / cheatsheet_link.txt
Created Dec 17, 2017
Links to Cheatsheets
View cheatsheet_link.txt
@vyuh
vyuh / typesetting_devnagari.xelatex
Created Dec 16, 2017
Typesetting Devnagari in XeLaTeX
View typesetting_devnagari.xelatex
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}
\catcode`\~=12
\setlength\parindent{0pt}
\begin{document}
@vyuh
vyuh / .fonts.conf
Last active Nov 11, 2017
Reject Bland fonts in Ubuntu
View .fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<include ignore_missing="yes">/absolute/path/to/select.conf</include>
</fontconfig>
@vyuh
vyuh / build-elm-platform-on-freebsd-11-1.sh
Last active Oct 26, 2017
Trying to document how I built Elm Platform on FreeBSD 11.1
View build-elm-platform-on-freebsd-11-1.sh
# 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 / install_heroku_without_sudo_linux.sh
Last active Nov 2, 2016
Install heroku without sudo on linux
View install_heroku_without_sudo_linux.sh
#!/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 / SQLITE_CLI_GARBLES_STRINGS.md
Last active Nov 18, 2016
Potential Bug Fix: Sqlite CLI removes CR characters in end of line even if they are inside quoted string literals.
View SQLITE_CLI_GARBLES_STRINGS.md

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

You can’t perform that action at this time.