Skip to content

Instantly share code, notes, and snippets.

Getting 1% better than yesterday

Eugene Oliveros yujinyuz

Getting 1% better than yesterday
View GitHub Profile


I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).


Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
yujinyuz / api_backends.conf
Created Aug 10, 2021 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
View api_backends.conf
upstream warehouse_inventory {
zone inventory_service 64k;
upstream warehouse_pricing {
zone pricing_service 64k;
yujinyuz /
Created Dec 20, 2020
Update tenant's
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from import BaseCommand
from django.db import connection
from django.db.models import Case, F, Value, When
from django_tenants.utils import schema_context
from tenant.models import Tenant
yujinyuz /
Created Nov 5, 2020
Allow debugging in production for superusers
# core/
import sys
from django.views.debug import technical_500_response
class UserBasedExceptionMiddleware:
def process_exception(self, request, exception):
if request.user.is_superuser:
return technical_500_response(request, *sys.exc_info())
yujinyuz / backup.crontab
Created Oct 25, 2020 — forked from rampion/backup.crontab
better vim backup strategy
View backup.crontab
# clean up any backups not used in the past 7 days out of the ~/.backup directory
@daily find ~/.backup -type f -name '*;*' -not \( -atime 0 -or -atime 1 -or -atime 2 -or -atime 3 -or -atime 4 -or -atime 5 -or -atime 6 \) -delete
yujinyuz /
Created Feb 16, 2020 — forked from przbadu/
Ctags for ruby on rails and node applications

Install ctags follow this url for installation and documentation.

Ctags with Ruby/Rails

We can ctags lots of programming languages. Here is how to do it for ruby/rails. I really like how RubyMine jumps to the source code (either withing project score or to the gem source). This is really useful for reading source code for those classes, methods, modules etc. But Now that I use vim as My IDE/Editor I really like that functionality to happen in my vim editor. And I found ctags as the solution.

yujinyuz / gist:55a8192e0435dcb864f87d9baa26bf61
Created Jul 4, 2018 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.
View gist:55a8192e0435dcb864f87d9baa26bf61

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
yujinyuz /
Created Mar 19, 2018 — forked from genomics-geek/
Setup ReactJS, Redux, Webpack with React Hot Reloading on an existing Django Project

Setting up ReactJS/Redux using Webpack for an existing Django project

This guide will help set up your django project to use ReactJS

1. Install Python dependencies

Add pip requirements to our django project:

  • django-webpack-loader==0.4.1 ( Connects Django project with Webpack)
yujinyuz /
Created Nov 19, 2017 — forked from killown/
List of Useful URL Patterns (Django)

Primary Key AutoField

Regex: (?P\d+)

url(r'^questions/(?P\d+)/$', views.question_details, name='question_details'),


|URL |Captures |

yujinyuz /
Created Oct 16, 2017 — forked from JeffPaine/
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]: