Skip to content

Instantly share code, notes, and snippets.

View arindampradhan's full-sized avatar
🎯
Focusing

Arindam Pradhan arindampradhan

🎯
Focusing
View GitHub Profile
@arindampradhan
arindampradhan / _helpers.scss
Created December 13, 2018 19:29
_helpers.scss
/**
space
-----
Spacing between elements as multiple of 5
**/
@arindampradhan
arindampradhan / service.md
Last active July 15, 2018 14:47
Axios service wrapper to wrap around a redux store. [SIMILAR TO REDUX-FORM]

request.js

/* eslint-disable */
/**
 * Axios Request Wrapper
 * ---------------------
 *  wraps arouund axios and redux
 */
@arindampradhan
arindampradhan / nginx-tuning.md
Created February 6, 2017 07:26 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@arindampradhan
arindampradhan / beautiful_idiomatic_python.md
Created December 22, 2016 15:23 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@arindampradhan
arindampradhan / steps_taken.sh
Created October 5, 2016 09:06
vncserver configuration .vnc/xstartup
#!/bin/sh
# Step 1 : Copy the above gist xstartup to .vns/xstartup. Remember the password you use for accessing the vncserver. Kill vncserver -> vncserver-kill :1
# Step 2 : Add the port no 5901 in your ec2 security group -> Custom TCP Rule | TCP | 5901 | 0.0.0.0/0
# Step 3 : Run tightvnc viewer, Write your public ip in remote host text box and port no. publicIp::port
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server
sudo apt-get install gnome-panel
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
@arindampradhan
arindampradhan / live.py
Created September 7, 2016 14:09
flask livereload setup
from flask import Flask, send_from_directory
from livereload import Server
app = Flask(__name__, static_url_path='/', static_folder='Views')
@app.route('/bower_components/<path:path>')
def send_assets(path):
return send_from_directory('bower_components', path)
@arindampradhan
arindampradhan / config.py
Created August 5, 2016 12:23
Config and manage script for flask | python
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = '' # os.urandom(24)
@arindampradhan
arindampradhan / .editorconfig
Created August 4, 2016 22:52
Editor Config file
# top-most EditorConfig file
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@arindampradhan
arindampradhan / pycet.md
Last active February 18, 2016 07:41
Short course on python programming language

Requirements

You should have python installed in your system. By default python is installed in Linux and Mac OSX. For Windows users you can install python here.

NOTE: Please install both Python2 and Python3. Linux is the recommended system.