Skip to content

Instantly share code, notes, and snippets.

View shashankgroovy's full-sized avatar
🏁
Godspeed

Shashank Srivastav shashankgroovy

🏁
Godspeed
View GitHub Profile
@shashankgroovy
shashankgroovy / analytics-models.md
Created August 27, 2019 10:17
Case study for analytics models

Case study

Let’s say you have been tasked to create a new feature, and you have to create a new schema, since the current ones don’t suffice the needs. In that case, below we list down the steps to achieve the same and also talk a bit about data modelling.

Creating a schema:

Creating a new schema is all about data modelling. So, make sure you study

@shashankgroovy
shashankgroovy / trees.py
Created July 29, 2016 05:46 — forked from prakhar1989/trees.py
Fun with binary trees
#!/usr/bin/python
import unittest
## binary tree problems
### A NODE OBJECT
class Node(object):
def __init__(self, data):
self.data = data
self.left = None
@shashankgroovy
shashankgroovy / graphs.py
Created July 29, 2016 05:46 — forked from prakhar1989/graphs.py
Simple Graph Algos
from collections import deque
from sys import maxint as MAXINT
# Breadth first search
def bfs(graph, start):
explored, queue = set([start]), deque([start])
while len(queue):
vertex = queue.popleft()
yield vertex
for neighbor in graph[vertex]:
@shashankgroovy
shashankgroovy / gist:a8f8394b890753a0e678971eeb9282a6
Created July 27, 2016 09:30 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
#!/bin/bash
# Description:
# EC2 setup.
# Based on Ubuntu, debian based systems
# Execution:
# First a lot the correct file permissions for the setup file:
# $ chmod 755 setup.sh
@shashankgroovy
shashankgroovy / nginx-setup.sh
Last active February 12, 2016 12:50
Script to automatically create all nginx configurations
#!/bin/bash
# Description:
# Nginx configurations
# Execution:
# First a lot the correct file permissions for the setup file:
# $ chmod 755 setup.sh
# And then simply run
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of the gist from this blog post.