Skip to content

Instantly share code, notes, and snippets.

@kshwetabh
kshwetabh / javascript_resources.md
Created November 11, 2013 18:22 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@kshwetabh
kshwetabh / css_resources.md
Created November 11, 2013 18:22 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@kshwetabh
kshwetabh / python_resources.md
Created November 11, 2013 18:22 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@kshwetabh
kshwetabh / chromeDevToolsSnippets.js
Last active December 28, 2015 01:09
Chrome Dev Tools Snippets
//Great online repo for more snippets: https://bgrins.github.io/devtools-snippets/
/*************************************************
//Cache Buster
Overwrite all link and (optionally) script tags by adding Date.now()
at the end of href and src attributes, respectively. By default processing
scripts is not performed, you should change the variable process_scripts
to true to run these.
/*************************************************/
(function (){
@kshwetabh
kshwetabh / JSHintTasks.xml
Created June 20, 2014 06:48
Ant based task to Lint the modified files with JSHint.
<?xml version="1.0" encoding="UTF-8"?>
<!-- @author Kumar Shwetabh, @version 1.0 -->
<!-- Based upon https://github.com/philmander/ant-jshint -->
<!-- Add reference to http://jslinterrors.com in the reports file -->
<project name="LintTasks" default="LintTasks" basedir=".">
<property name="FilesToLint" value="C:/LintFiles"/>
<property name="ReportFile" value="${basedir}/jshint/results.html"/>
<target name="LintTasks">
@kshwetabh
kshwetabh / XoomXChangeRateTrendGraph.gs
Last active June 17, 2018 14:23
Xoom Exchange Rate Trend - Draws a graph indicating the exchange rate trend of Xoom.com Online Money Transfer Website.
/**
* Services combined together:
* ~Yahoo Pipes~, Gmail, Google App Script, GDrive, Google Charts
*
* This is a Google App Script Web App that draws a Column Graph highlighting the current and historical exchange rate trend of
* Xoom Money Transfer. Created this simple app to keep an eye on the $ to Rupee up/down trend.
* Has a related excel sheet also.
*
* Output (snapshot): https://plus.google.com/photos/108969069990423509081/albums/6115274347350257297?authkey=CKOFv9-t77O4kAE
*
@kshwetabh
kshwetabh / LoadDataIntoPostgreSQL.py
Created January 11, 2018 04:06
Use this script to load NIFTY Intraday data into PostgreSQL Database
import psycopg2
conn = psycopg2.connect("host='localhost' port='5432' dbname='stocks' user='xxxxxx' password='xxxxxx'")
cur = conn.cursor()
SQL_STATEMENT = """
COPY %s FROM STDIN WITH
CSV
HEADER
DELIMITER AS ','
"""
@kshwetabh
kshwetabh / useful_pandas_snippets.py
Created January 11, 2018 04:11 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
@kshwetabh
kshwetabh / JavaScript Convenient Logger.js
Last active July 25, 2019 05:45
A convenient method to direct console.log/error statements to be written into a DIV and in browser's console.
//Code borrowed from: https://github.com/aws-samples/amazon-kinesis-video-streams-media-viewer
function configureLogging() {
console._error = console.error;
console.error = function(messages) {
log('ERROR', Array.prototype.slice.call(arguments));
console._error.apply(this, arguments);
}
console._log = console.log;
@kshwetabh
kshwetabh / android_video_stream_to_opencv.py
Last active August 14, 2019 05:11
This script requires IPCam app (or any other app that can stream images/videos over HTTP) to be installed on Android device and OpenCV to installed on Desktop machine. On running this script, OpenCV will detect front-faces in videos streamed on the desktop. #python #opencv #android #face-detection
import requests
import cv2
import numpy as np
# Online code reference: https://www.youtube.com/watch?v=-mJXEzSD1Ic
# Image URL being streamed from IPWebCam app (I used the one written by Pavel Khlebovich).
# Make sure that the android device and the machine running opencv are on the same network and
# you can access the streaming URL from that machine
url = 'http://192.168.43.236:8080/shot.jpg'