Skip to content

Instantly share code, notes, and snippets.

@shaunakpp
shaunakpp / .spacemacs.el
Last active June 29, 2019 20:53
.spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@shaunakpp
shaunakpp / snake_coin.rb
Last active November 23, 2018 05:15
Basic Blockchain Implementation in Ruby
require 'digest'
# A Snake Coin Block, stores data and it's hashed content
class Block
attr_reader :index, :timestamp, :data, :previous_hash, :hash
def initialize(index, timestamp, data, previous_hash)
@index = index
@timestamp = timestamp
@data = data
@previous_hash = previous_hash
@shaunakpp
shaunakpp / prophet_demo.py
Created July 26, 2017 07:51
Prophet Demo
# import libraries
import pandas as panda_data_frame
import numpy as num_py
from fbprophet import Prophet
# create a data frame from the csv file, log-transform for normality
df = panda_data_frame.read_csv('clicks.csv')
df['y'] = num_py.log(df['y'])
df.head()
@shaunakpp
shaunakpp / staggered.rb
Created July 18, 2017 09:00
lazy staggered iteration
class Lookup
attr_reader :person, :service
def initialize(person)
@person = person
@service = ThirdPartyService.new
end
def find_match
lookups = [