Skip to content

Instantly share code, notes, and snippets.

View suvirbhargav's full-sized avatar
👋

suvirb suvirbhargav

👋
View GitHub Profile
@topheman
topheman / .vimrc
Last active March 9, 2024 09:48
vim-config on Mac OS X
" Vundle config
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')
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ceteri
ceteri / 00.graphx.scala
Last active September 9, 2021 13:38
Spark GraphX demo
import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD
case class Peep(name: String, age: Int)
val vertexArray = Array(
(1L, Peep("Kim", 23)),
(2L, Peep("Pat", 31)),
(3L, Peep("Chris", 52)),
(4L, Peep("Kelly", 39)),
@kevindavenport
kevindavenport / FB_quicklook.ipynb
Last active December 26, 2015 02:29
Quick look at Kaggle's Facebook Competition Data with Python, Pandas, R, and Numpy.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh -vex
# needed rpms
yum -y install ncurses-devel git gcc rpmbuild
TEMPDIR="$(mktemp -d)"
HERE="$(pwd)"
printf "building at: %s\n" $TERMDIR
cd $TEMPDIR
@doobeh
doobeh / example.html
Last active April 19, 2022 10:25 — forked from anonymous/siecje.py
Simple example of using a RadioField in Flask-WTForms to generate a form.
<form method="post">
{{ form.hidden_tag() }}
{{ form.example }}
<input type="submit">
</form>
@endJunction
endJunction / config.xml
Created November 7, 2012 11:08
boost::property_tree and xml config example
<coupling>
<P algorithm="serial">
<M name="flow1" type="GROUNDWATER_FLOW" />
<P algorithm="parallel">
<M name="compoundA" type="MASS_TRANSPORT" />
<M name="compoundB" type="MASS_TRANSPORT" />
</P>
</P>
</coupling>
@larsmans
larsmans / hellinger.py
Created July 15, 2012 13:25
Hellinger distance for discrete probability distributions in Python
"""
Three ways of computing the Hellinger distance between two discrete
probability distributions using NumPy and SciPy.
"""
import numpy as np
from scipy.linalg import norm
from scipy.spatial.distance import euclidean
@mloskot
mloskot / boost_property_tree_json_array.cpp
Created December 22, 2011 11:11
Simple example of parsing and consuming JSON array with boost::property_tree
#ifdef _MSC_VER
#include <boost/config/compiler/visualc.hpp>
#endif
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/foreach.hpp>
#include <cassert>
#include <exception>
#include <iostream>
#include <sstream>
@arfoll
arfoll / python_avahi_browse.py
Created February 8, 2011 10:05
Python equivalent to avahi-browse service
#!/usr/bin/python
import sys
try:
import gobject
import avahi
import dbus
import gtk
import avahi.ServiceTypeDatabase