Skip to content

Instantly share code, notes, and snippets.

View hussaintamboli's full-sized avatar

Hussain Tamboli hussaintamboli

View GitHub Profile
@siddharthkp
siddharthkp / reactivconf-2017-proposal.md
Last active February 25, 2024 10:06
Building applications for the next billion users
@mburakerman
mburakerman / package.json
Last active September 26, 2022 17:32
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@jgwerner
jgwerner / nginx.conf
Last active July 14, 2017 10:16
openresty-nginx.conf.
worker_processes auto;
error_log /dev/stdout debug;
events {
worker_connections 2048;
}
http {
upstream flaskserver {
ip_hash;
@azimidev
azimidev / _Laravel_Queue_Supervisor_Instruction.md
Last active November 15, 2022 14:42 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@viksit
viksit / async_flask.py
Created March 28, 2016 20:01 — forked from sergray/async_flask.py
Asynchronous requests in Flask with gevent
"""Asynchronous requests in Flask with gevent"""
from time import time
from flask import Flask, Response
from gevent.pywsgi import WSGIServer
from gevent import monkey
import requests
@kylefox
kylefox / post_compile.sh
Last active October 23, 2020 08:42
Run Django database migrations after deploy to Heroku. This file must live at `bin/post_compile` within your root project directory.
# !/usr/bin/env bash
# File path should be ./bin/post_compile
# (.sh extension added in Gist just to enable shell syntax highlighting.
# https://discussion.heroku.com/t/django-automaticlly-run-syncdb-and-migrations-after-heroku-deploy-with-a-buildpack-or-otherwise/466/7
echo "=> Performing database migrations..."
python manage.py migrate
def main():
testobj_0 = MemoMethods('test0')
testobj_1 = MemoMethods('test1')
wrong0 = testobj_0.foo_borked
right0 = testobj_0.foo_fixed
wrong1 = testobj_1.foo_borked
right1 = testobj_1.foo_fixed
# this is the bug, wrong0's method is run with test1 as self
@bradmontgomery
bradmontgomery / examples.py
Last active January 15, 2018 03:47
Sample code illustrating some uses of Mock; These tests will pass if you have nose, but the code doesn't really do anything.
import requests
from pygithub3 import Github
# Example: Hit a 3rd-party API
# ----------------------------
def get_user(username):
gh = Github()
return gh.users.get(username)
@codeinthehole
codeinthehole / run.py
Created November 21, 2012 13:46
Sample Celery chain usage for processing pipeline
from celery import chain
from django.core.management.base import BaseCommand
from . import tasks
class Command(BaseCommand):
def handle(self, *args, **kwargs):