Skip to content

Instantly share code, notes, and snippets.

View jbonfante's full-sized avatar

Juan Bonfante jbonfante

View GitHub Profile
@jbonfante
jbonfante / import_pitfall_lessons.ts
Created August 29, 2017 21:13
What I think i know about ES6 imports
// 1. Global import
import 'rxjs/operator/map';
// - Generally imports to top-level Object adding methods
// -- through prototypical inheritance (mostly)
// -- can act on ALL objects and classes
// -- can potentially override js internals altogether
// -- harder to tree-shake if done incorrectly
// 2. Curly import
import { Action } from '@ngrx/store';
@jbonfante
jbonfante / rails_form_helpers.erb
Created February 10, 2016 16:08
RAILS FORM HELPERS
1.4 Other Helpers of Interest
Other form controls worth mentioning are textareas, password fields, hidden fields, search fields, telephone fields, date fields, time fields, color fields, datetime fields, datetime-local fields, month fields, week fields, URL fields, email fields, number fields and range fields:
<%= text_area_tag(:message, "Hi, nice site", size: "24x6") %>
<%= password_field_tag(:password) %>
<%= hidden_field_tag(:parent_id, "5") %>
<%= search_field(:user, :name) %>
<%= telephone_field(:user, :phone) %>
<%= date_field(:user, :born_on) %>
<%= datetime_field(:user, :meeting_time) %>
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@jbonfante
jbonfante / uwsgi_staging.ini
Created April 20, 2014 13:06
Sample uwsgi file for a dev/staging server, under py3k and django 1.6
[uwsgi]
chdir = /var/www/django/app
module = app.wsgi_staging
virtualenv=/var/www/django/env/
env = DJANGO_SETTINGS_MODULE=app.settings.staging
socket = /tmp/app.sock
master = 1
workers = 2
chmod-socket = 666
auto-procname = 1
@jbonfante
jbonfante / nginx-django.conf
Created April 20, 2014 13:03
Sample NginX config file for running django 1.6 under python 3.4, using uwsgi and sockets
upstream django {
ip_hash;
server unix:/tmp/django.sock;
# server unix:/tmp/fastrouter.socket;
}
server {
listen 80;
# listen 443 ssl;
upstream uwsgi {
ip_hash;
server 127.0.0.1:40000;
}
server {
listen 80;
server_name www.domain.com;
root /sites/mysite/;
access_log /sites/mysite/log/nginx/access.log;
from fabric.api import local
import pip
def freeze ():
local("pip freeze > requirements.txt")
local("git add requirements.txt")
local("git commit -v")
def upgrade ():
for dist in pip.get_installed_distributions():