Skip to content

Instantly share code, notes, and snippets.

View venkatesh22's full-sized avatar

Venkatesh venkatesh22

View GitHub Profile
@venkatesh22
venkatesh22 / determine-changed-props.js
Created June 29, 2020 08:20 — forked from sorenlouv/determine-changed-props.js
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@venkatesh22
venkatesh22 / gist:e13e9bd0dfd1f1bafc1d4a851d42683c
Created June 16, 2020 04:12 — forked from danesparza/gist:1093992
Javascript date range overlap
var e1start = e1.start.getTime();
var e1end = e1.end.getTime();
var e2start = e2.start.getTime();
var e2end = e2.end.getTime();
return (e1start > e2start && e1start < e2end || e2start > e1start && e2start < e1end);
@venkatesh22
venkatesh22 / strophe.receipts.js
Created February 3, 2020 09:08 — forked from iadvize/strophe.receipts.js
a strophe plugin implementing XEP-0184
Strophe.addConnectionPlugin('receipts', {
_conn: null,
_msgQueue: {},
_retries: {},
_resendCount: 10,
_resendTime: 9000,
init: function(conn) {
this._conn = conn;
Strophe.addNamespace('RECEIPTS', 'urn:xmpp:receipts');
@venkatesh22
venkatesh22 / gitstats.sh
Created April 3, 2019 09:28 — forked from xeoncross/gitstats.sh
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@venkatesh22
venkatesh22 / ngrxintro.md
Created June 28, 2018 05:35 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@venkatesh22
venkatesh22 / routers.py
Created May 11, 2018 19:56 — forked from artschwagerb/routers.py
Django Database Routers Master-Slave
import random
class MasterSlaveRouter(object):
def db_for_read(self, model, **hints):
"""
Reads go to a randomly-chosen slave.
"""
return random.choice(['master','slave1', 'slave2'])
def db_for_write(self, model, **hints):
@venkatesh22
venkatesh22 / amazon-rekognition.md
Created May 3, 2018 18:22 — forked from alexcasalboni/amazon-rekognition.md
Amazon Rekognition - Python Code Samples

Amazon Rekognition - Python Code Samples

  1. Labels Detection
  2. Faces Detection
  3. Faces Comparison
  4. Faces Indexing
  5. Faces Search
@venkatesh22
venkatesh22 / introrx.md
Created December 18, 2017 05:29 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@venkatesh22
venkatesh22 / README.md
Created July 25, 2016 05:46 — forked from jczaplew/README.md
Detecting double taps with d3.js

A simple example showing how to detect a double tap with d3.js, and an accompanying method for reusability.