Skip to content

Instantly share code, notes, and snippets.

Avatar
🏁
Godspeed

Shashank Srivastav shashankgroovy

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

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 Jul 29, 2016 — forked from prakhar1989/trees.py
Fun with binary trees
View trees.py
#!/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 Jul 29, 2016 — forked from prakhar1989/graphs.py
Simple Graph Algos
View graphs.py
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 Jul 27, 2016 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
View gist:a8f8394b890753a0e678971eeb9282a6
  1. General Background and Overview
View setup.sh
#!/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 Feb 12, 2016
Script to automatically create all nginx configurations
View nginx-setup.sh
#!/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
View node-and-npm-in-30-seconds.sh
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
View hash.c
#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;
View about.md

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.

View about.md