Skip to content

Instantly share code, notes, and snippets.

@dmadisetti
dmadisetti / .vimrc
Last active September 28, 2019 05:45
.files
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@dmadisetti
dmadisetti / .completion
Created April 12, 2017 22:57
Bash script for github management
#!/bin/bash
# Make sure you source this in rc
gh(){
local folder="/home/dylan/projects/github" \
archive="/home/dylan/projects/archive" \
regex="[a-zA-Z]+[a-zA-Z0-9_-]*" \
USERNAME="dmadisetti" \
# Deal with projects
@dmadisetti
dmadisetti / befunge.js
Last active December 7, 2016 22:54
Functional JS implementation of Befunge Interpeter
const BEFUNGE = ()=>{
var c, r;
var s = [],
i = 0,
j = 0,
di = 0,
dj = 1,
e = 0,
set = (a,b)=>{di=b;dj=a},
@dmadisetti
dmadisetti / brainfuck.js
Last active December 7, 2016 18:13
Functional implementation of a BF interpreter in JS
const BF = (M)=>{
const d=(new Array(0x100)).fill(0);
for(m in (M || []).slice(0,0x100)) d[m]+=M[m]|0;
var x = 0,
i = 0,
s = [],
c, r;
const I = {
@dmadisetti
dmadisetti / FEM_Mesh_Refinement.py
Created October 11, 2016 22:06
Refine Mesh against Reddy's FEM1D Fortran program
from os import system
# Text file templates to build our mesh file
HEADER = """Mesh #%d | Dylan Madisetti FEA Project | Description
3 0 0 | | MODEL, NTYPE, ITEM | Euler Bernoulli Beam problem
0 %d | | IELEM, NEM | Hermite spline / # of Elements
0 1 | | ICONT, NPRINT | Data is Element Dependent / Postprocess and Print
%d | | NNM | Total number of self.nodes
"""
alignment top_right
background yes
border_width 1
cpu_avg_samples 2
default_color 6b6b6b
default_outline_color white
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
@dmadisetti
dmadisetti / .vim.tar.gz
Last active August 28, 2016 17:59
Vim Configuration

Keybase proof

I hereby claim:

  • I am dmadisetti on github.
  • I am dmadisetti (https://keybase.io/dmadisetti) on keybase.
  • I have a public key whose fingerprint is DD00 5F54 FA00 E8B5 412A BA53 5949 7741 73B1 C8EC

To claim this, I am signing this object:

@dmadisetti
dmadisetti / 2d.html
Last active March 28, 2016 22:25
For the up and coming blog post
<!doctype>
<html>
<head>
<title>Visualizing primes</title>
<style>
body {
font-family: Monospace;
background-color: #fff;
@dmadisetti
dmadisetti / markov.py
Created November 2, 2015 07:05
Markov-lyrics
file = open('beattles', 'r')
import random, string
global pointer, M, states
M = {}
states = {}
# Class to hold 'States'
class State:
# Keep paths with obj scope