Skip to content

Instantly share code, notes, and snippets.

View lafolle's full-sized avatar
🎯
Focusing

Karan Chaudhary lafolle

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lafolle on github.
  • I am lafolle (https://keybase.io/lafolle) on keybase.
  • I have a public key whose fingerprint is EA2A 670E FCA8 9B01 A3E2 AF22 9384 6835 01DB B74C

To claim this, I am signing this object:

@lafolle
lafolle / basic_proxy.go
Last active December 6, 2018 08:47
Basic TCP proxy
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
)
@lafolle
lafolle / README.md
Last active August 29, 2015 14:25
Custom Slack Command to post random XKCD comic to Slack channel

There are 1500 comics in XKCD. This server/handler post a random comic (title, imgurl) to slack slack channel.

As response of Slack Custom Command cannot be unfurled by Slack, we make a post webhook request to the channel from which /xkcd command is issued.

@lafolle
lafolle / gist:7943489
Last active December 31, 2015 05:49
Fish shell script which automatically activates the virtual environment when a particular directory becomes 'present working directory'. A map data structure would have been of good use, but its not present in fish shell. Though it is present in bash-4.x (see declare -A). I called it in /usr/local/share/fish/functions/cd.fish, inside cd function…
# This automatically activates the virtual environment when a particular
# directory becomes 'present working directory'
function activatevirtualenvironment
# Activate virtual environment if some particular directory is pwd.
set -l virtual_environment_dir $argv
switch (pwd)
case /Users/lafolle/hp/Awesome