Skip to content

Instantly share code, notes, and snippets.

View afnanenayet's full-sized avatar

Afnan Enayet afnanenayet

  • Citadel (Global Quantitative Strategies)
  • New York City, New York
  • 20:56 (UTC -04:00)
View GitHub Profile
@afnanenayet
afnanenayet / blockapi.py
Last active February 14, 2022 04:27
Add FIPS data to a CSV
"""A script to augment a CSV with FIPS data.
"""
import requests
import requests_futures
import pandas as pd
from typing import cast, Dict, Any
import pdb
import numpy as np
from loguru import logger
@afnanenayet
afnanenayet / cluster_wrapper_script.sh
Created April 9, 2019 02:53
Generate a render with PBRT on the Dartmouth Anthill cluster
#!/bin/bash
# The name of the job, can be anything, simply used when displaying the list of running jobs
#$ -N pbrt-killeroos-render
# Combining output/error messages into one file
#$ -j y
# Set memory request:
#$ -l vf=1G
# Set walltime request:
#$ -l h_rt=02:59:59
# set num threads
@afnanenayet
afnanenayet / keybase.md
Created June 30, 2018 15:30
Proof of identity for Keybase

Keybase proof

I hereby claim:

  • I am afnanenayet on github.
  • I am afnanenayet (https://keybase.io/afnanenayet) on keybase.
  • I have a public key ASAQkK2dLCXxSZGcZgjBXohhb3D5-MaFg2O2vF77TQKzNwo

To claim this, I am signing this object:

" deoplete.vim contains vim settings relevant to the deoplete autocompletion
" plugin
" for more details about my neovim setup see:
" http://afnan.io/2018-04-12/my-neovim-development-setup/
" deoplete options
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
" disable autocomplete by default
# Implements a logistic regression with mini-batch gradient descent using tensorflow
# testing with the sklearn moons dataset
import tensorflow as tf
import numpy as np
from datetime import datetime
from sklearn.datasets import make_moons
def get_tb_dir(prefix=None) -> str:
# Implements a logistic regression with mini-batch gradient descent using tensorflow
# testing with the sklearn moons dataset
import tensorflow as tf
import numpy as np
from datetime import datetime
from sklearn.datasets import make_moons
def get_tb_dir(prefix=None) -> str:
@afnanenayet
afnanenayet / gdb_valgrind_example.c
Last active December 17, 2021 21:18
An example program that used to demonstrate how to use GDB/LLDB and Valgrind with the tutorial at http://www.afnan.io/debugging-c-with-gdb-and-valgrind/
/* gdb_valgrind_example.c Afnan Enayet
*
* An example designed to help a user understand how to
* use GDB/LLDB and Valgrind
*
* Functions:
* - init_str: a functions that initializes a string
* to "hello"
*
*/
@afnanenayet
afnanenayet / iter_args.sh
Created July 9, 2017 22:54
An example of how to iterate through command line arguments in shell script
# Iterate through arguments supplied from the command line with
# a loop in Bash script
for arg in "$@"
do
echo "$arg"
done
# Example usage:
# ./iter_args.sh 1 2 3 4 5
@afnanenayet
afnanenayet / args.c
Created July 3, 2017 16:18
Command line arguments activity solution
/*
* atoi - read an integer from each argument,
* and print them to stdout. catch errors.
*
* usage: ./atoi [integer]...
*
* CS50, July 2017
*/
#include <stdio.h>
@afnanenayet
afnanenayet / valid_cpp_loops.cpp
Last active July 26, 2016 02:59
Different ways to construct the same loop in C++
#include <iostream>
using namespace std;
#ifdef __cplusplus
extern "C" {
#endif
void loop();
#ifdef __cplusplus