Skip to content

Instantly share code, notes, and snippets.

View oyeb's full-sized avatar
🎯
Focusing

Ananya Bahadur oyeb

🎯
Focusing
View GitHub Profile
@oyeb
oyeb / iitb-vpn-ssh.md
Last active March 6, 2022 07:19
Accessing IITB from outside

Avoid the VPN -- use SSH tunnel

If you use the VPN all your private browsing gets tunneled thru IITB -- and why the hell would you want that? Just use the SSH tunnel at login.iitb.ac.in.

You can access it by:

ssh -p xxxx <ldap-user>@login.iitb.ac.in

The port number can be found on the computer center's website.

@oyeb
oyeb / config.yaml
Created August 1, 2019 05:28
stack global config
# This file contains default non-project-specific settings for 'stack', used
# in all projects. For more information about stack's configuration, see
# http://docs.haskellstack.org/en/stable/yaml_configuration/
# The following parameters are used by "stack new" to automatically fill fields
# in the cabal config. We recommend uncommenting them and filling them out if
# you intend to use 'stack new'.
# See https://docs.haskellstack.org/en/stable/yaml_configuration/#templates
local-programs-path: <HASKELL_STACK_ROOT>/programs/
@oyeb
oyeb / .emacs
Created August 1, 2019 05:08
Suggested emacs config (with stack)
;; Drop this in your ~/.emacs OR ~/.emacs.d/init.el
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
'("org" . "https://orgmode.org/elpa/"))
(package-initialize)
;; Bootstrap `use-package'
@oyeb
oyeb / .emacs
Last active August 1, 2019 05:06
Suggested emacs config (without stack)
;; Drop this in your ~/.emacs OR ~/.emacs.d/init.el
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
'("org" . "https://orgmode.org/elpa/"))
(package-initialize)
;; Bootstrap `use-package'
@oyeb
oyeb / sagepay.iex.exs
Created June 6, 2018 17:31
Some handy IEx bindings for the SagePay gateway
alias Gringotts.{CreditCard, Response}
card = %CreditCard{
number: "4929000005559",
month: 3,
year: 20,
first_name: "SAM",
last_name: "JONES",
verification_code: "123",
brand: "VISA"
@oyeb
oyeb / money_test.exs
Created June 6, 2018 09:50
Tests for ex_money's protocol implementation
alias Gringotts.Money, as: MoneyProtocol
describe "Gringotts.Money protocol implementation" do
# You may not need this one :)
test "currency is an upcase String.t" do
the_currency = MoneyProtocol.currency(Money.new(0, :USD))
assert match?(currency when is_binary(currency), the_currency)
assert the_currency == String.upcase(the_currency)
end
test "to_integer" do
@oyeb
oyeb / pre-commit
Created February 12, 2018 10:11
A pre-commit hook that DRY-runs the elixir formatter
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
@oyeb
oyeb / global_collect.iex.exs
Created February 1, 2018 11:51
Some frequently used bindings for GlobalCollect
# Handy bindings when developing the GlobalCollect gateway integration.
# Most of the bindings are for the `opts`
# Instructions
# Just rename this file to `.iex.exs` and save it in either,
# 1. the gringotts root directory
# 2. your applications root directory
# essentially the place where you launche your `iex` sessions via `iex -S mix`.
@oyeb
oyeb / cams.iex.exs
Last active February 1, 2018 12:17
Some frequently used bindings for CAMS
# Handy bindings when developing the CAMS gateway integration.
# Most of the bindings are for the `opts`
# Instructions
# Just rename this file to `.iex.exs` and save it in either,
# 1. the gringotts root directory
# 2. your applications root directory
# essentially the place where you launch your `iex` sessions via `iex -S mix`.
@oyeb
oyeb / trexle.iex.exs
Last active February 1, 2018 12:16
Some frequently used bindings for Trexle development
# Handy bindings when developing the Trexle gateway integration.
# Most of the bindings are for the `opts`
# Instructions
# Just rename this file to `.iex.exs` and save it in either,
# 1. the gringotts root directory
# 2. your applications root directory
# essentially the place where you launch your `iex` sessions via `iex -S mix`.