Skip to content

Instantly share code, notes, and snippets.

View khursani8's full-sized avatar
🏠
Working from home

Sani khursani8

🏠
Working from home
View GitHub Profile
mappings = {
'a':'a',
'i':'i',
'u':'u',
'e':'e',
'o':'o',
'ka':'ka',
'ki':'ki',
'ku':'ku',
@khursani8
khursani8 / copy_templates.sh
Last active May 19, 2021 04:35
create new event based on templates
cp -r apps/events/templates/129 apps/events/templates/131
mkdir -p static/bundles/131
cp -r static/bundles/129/* static/bundles/131/
mkdir -p static/images/events/131
cp -r static/images/events/129/* static/images/events/131/
mkdir -p static/src/js/events/131
cp -r static/src/js/events/129/* static/src/js/events/131/
@khursani8
khursani8 / cml.sh
Last active December 3, 2020 14:00
cml colab
set -ex
echo $(pwd)
RUNNER_PATH=/home/runner
RUNNER_ALLOW_RUNASROOT=1
mkdir ${RUNNER_PATH}
cd ${RUNNER_PATH}
echo $(pwd)
echo $1
echo $2
# echo -e RUNNER_ALLOW_RUNASROOT=1\\nRUNNER_LABELS=cml,gpu\\nRUNNER_IDLE_TIMEOUT=72000\\nRUNNER_PATH\\nRUNNER_REPO=$1\\nrepo_token=$2\\n > /home/runner/.env
@khursani8
khursani8 / test.js
Created September 17, 2019 16:00
node performance test
let crypto = require('crypto');
const salt = 'lone-star',
iterations = 10000,
len = 16,
digest = 'sha512';
const REPEATS = 10;
const NUMBER_COUNT = 10000000;
@khursani8
khursani8 / nvidia-reinstall.sh
Created April 30, 2019 02:46 — forked from morgangiraud/nvidia-reinstall.sh
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
@khursani8
khursani8 / StandardToken.sol
Created August 26, 2018 10:29
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.24;
contract StandardToken {
struct Task {
string title; // weight is accumulated by delegation
string description; // if true, that person already voted
string expiryDate;
uint timeLimit;
uint totalLabeled;
uint totalBacked;
@khursani8
khursani8 / ERC20.sol
Last active August 26, 2018 10:28
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.10;
interface ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
@khursani8
khursani8 / Coursetro.sol
Created June 8, 2018 16:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.18;
contract Coursetro{
string fName;
uint age;
function setInstructor(string _fName, uint _age) public {
fName = _fName;
age = _age;
}
@khursani8
khursani8 / Seq2SeqAttnWithBeam.py
Created April 23, 2018 16:46 — forked from movefast/Seq2SeqAttnWithBeam.py
Seq2Seq rnn with beam search
class Seq2SeqAttnRNN(nn.Module):
def __init__(self, vecs_enc, itos_enc, em_sz_enc, vecs_dec, itos_dec, em_sz_dec, nh, out_sl, nl=2):
super().__init__()
self.emb_enc = create_emb(vecs_enc, itos_enc, em_sz_enc)
self.nl,self.nh,self.out_sl = nl,nh,out_sl
self.gru_enc = nn.GRU(em_sz_enc, nh, num_layers=nl, dropout=0.25)
self.out_enc = nn.Linear(nh, em_sz_dec, bias=False)
self.emb_dec = create_emb(vecs_dec, itos_dec, em_sz_dec)
self.gru_dec = nn.GRU(em_sz_dec, em_sz_dec, num_layers=nl, dropout=0.1)
self.emb_enc_drop = nn.Dropout(0.15)
#include <iostream>
using namespace std;
int palindrome(string &str,int start,int end){
if(start >= end)
return 1;
if(str[start] != str[end])
return 0;
return palindrome(str,++start,--end);