Skip to content

Instantly share code, notes, and snippets.

View tusqasi's full-sized avatar

Tushar Kuntawar tusqasi

View GitHub Profile
@tusqasi
tusqasi / primes.ex
Created September 14, 2022 15:53
A prime process with client
# Run with
# $ iex primes.ex
# > Client.start
defmodule Primes do
def is_prime(n) when n == 2 or n == 1 do
true
end
def is_prime(n) when n > 2 do
@tusqasi
tusqasi / installation.sh
Created September 14, 2022 03:16
Elixir and erlang installation for eyantra
sudo apt-get install build-essential git wget libssl-dev libreadline-dev libncurses5-dev zlib1g-dev m4 curl wx-common libwxgtk3.0-dev autoconf libxml2-utils xsltproc fop unixodbc unixodbc-bin unixodbc-dev
# installation of asdf
cd
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.4
# For Ubuntu or other linux distros
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
from itertools import permutations, combinations_with_replacement
def and_g(a: bool, b: bool) -> bool:
return a and b
def or_g(a: bool, b: bool) -> bool:
return a or b
# question 1
from random import randint, seed
def disp_fraction(f: list):
return f"{' ' if f[0] == 0 else f[0]} {f[1]}/{f[2]}"
def main(ans: tuple[int, int, int]):
opts = []
@tusqasi
tusqasi / 2_april_2022.md
Last active April 2, 2022 19:54
Vatsalya meet points

Tasks Done

  • Box collection

  • Paper uploading

    • Done
  • Email

  • FY question paper, analysis.

  • Box placement

    • FY done by monday
#!/data/data/com.termux/files/usr/bin/bash
cd $(dirname $0)
## unset LD_PRELOAD in case termux-exec is installed
unset LD_PRELOAD
command="proot"
command+=" --link2symlink"
command+=" -0"
command+=" -r ubuntu-fs"
if [ -n "$(ls -A ubuntu-binds)" ]; then
for f in ubuntu-binds/* ;do