Skip to content

Instantly share code, notes, and snippets.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"profiles": {
"defaults": {
@rahulkmr
rahulkmr / oop.js
Last active April 10, 2017 10:06
// Helper for implementing mixins.
function mixin(dest) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var prop in source) {
if (!dest[prop]) {
dest[prop] = source[prop];
}
}
}
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
class HTTPRequest(BaseHTTPRequestHandler):
def __init__(self, request_text):
self.rfile = StringIO(request_text)
self.raw_requestline = self.rfile.readline()
self.error_code = self.error_message = None
self.parse_request()
# -*- coding: utf-8 -*-
"""
flaskext.sqlalchemy
~~~~~~~~~~~~~~~~~~~
Adds basic SQLAlchemy support to your application.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
author "Rahul Kumar <[email protected]>"
description "Disable ATI cards at start-up"
start on desktop-session-start
exec echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
# remap prefix to C-a
unbind C-b
set -g prefix C-a
bind a send-prefix
# force a reload of the config files.
unbind r
bind r source-file ~/.tmux.conf
# Screen like bindings.
user root;
worker_processes 4;
# [ debug | info | notice | warn | error | crit ]
events {
worker_connections 1024;
}
http {
#!/usr/bin/env python
import gevent
from gevent.pywsgi import WSGIServer
from gevent import monkey
monkey.patch_all()
from flask import Flask, Response
app = Flask(__name__)
#!/usr/bin/env python
import gevent
from gevent.pywsgi import WSGIServer
from gevent import monkey
monkey.patch_all()
from flask import Flask, Response
app = Flask(__name__)