Skip to content

Instantly share code, notes, and snippets.

Jose Miguel Colella josecolella

Block or report user

Report or block josecolella

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Express-Typescript
import * as path from 'path';
import * as express from 'express';
import * as logger from 'morgan';
import * as bodyParser from 'body-parser';
const app = express();
View gist:3a58765a156eec71c8705f1f6aca342b

What are Migrations

Just like how we use Git to version control source code, we use migrations to manage the state of our database schemas.

I'm not really sure what that means...

Imagine you're working on project with another developer, and you're both tasked with creating a specific part of an event planning application. Let's say you are in charge of creating the Users and your friend is going to create the Events.

Let's say you and your friend divided the work in a way so that neither of you will have to to use each other's code to finish your tasks. While you're working on your part of the application, you only really need to touch the Users table when you are working with the database.

Creating models and migrations

View AgenciesToImport.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Id;Name;Site Type;Region;Area;UDL;WAN;Link Speed In;Link Speed Out;Comment;Domains
;GA_0853;Manual;AGENZIA;SENORBI';false;false;;;;192.168.99.97-192.168.99.126
;GA_0204;Manual;AGENZIA;MILANO PORTA TICINESE;false;false;;;;192.168.99.65-192.168.99.94
;GA_0854;Manual;AGENZIA;SEGRATE;false;false;;;;192.168.99.225-192.168.99.254
;GA_0429;Manual;AGENZIA;FIUMICINO;false;false;;;;192.168.99.193-192.168.99.222
;GA_999A;Manual;AGENZIA;AGENZIA DI TEST DIREZIONE;false;false;;;;192.168.99.161-192.168.99.190
;GA_0249;Manual;AGENZIA;PATERNO';false;false;;;;192.168.99.1-192.168.99.30
;GA_0478;Manual;AGENZIA;SAN GIOVANNI IN PERSICETO;false;false;;;;192.168.98.97-192.168.98.126
;GA_0423;Manual;AGENZIA;CESANO MADERNO;false;false;;;;192.168.98.65-192.168.98.94
;GA_0426;Manual;AGENZIA;COLLECCHIO;false;false;;;;192.168.98.33-192.168.98.62
View ElencoAgencia.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
Codice,Tipologia,Nome,Indirizzo,Telefono,Cellulare,TGU Principale,TGU Secondaria,LoopBack Principale,LoopBack Secondaria,Network,Subnet Mask,IP HSRP,IP SWITCH,Router Principale,Router Secondario,Note
WIFIPAVESE,SEDEROMA,WiFi Pavese,Via Cesare Pavese 385,,,10-0613909286,,,,31.195.2.56/248/255.255.255.24,255.255.255.24,,,,,Questo impianto permette il collegamento WIFI di tutto lo stabile Per aprire un Ticket a Telecom per guasto sull???impianto ADSL 7M F7 Mbpscon BMG 1024 kbps 512 kbps di viale Cesare Pavese 385 telefonare al N?? 800018914 digitare il 1 - 1 . Il telefono assegnato alla WiFi ?? il 0613909286. Il Router ?? di tipo THOMSON Informazioni utili: TGU 10- 0613909286 P2P 85.39.2.120 / 252 LAN 31.195.2.56/248 PC 31.195.2.58(WiFi) - 62 Gateway 255.255.255.24
GA_0836,AGENZIA,BOLOGNA SABATINI,"CORSO LORENZO SABATINI, 3",5119980051,FAILLACE LUCA 3299822408,,,,,192.168.129.0/255.255.255.224,255.255.255.224,192168.129.30,,192168.129.29,192168.129.28,BERTOLDI ROBERTO 3488502259
GA_0853,AGENZIA,SENORBI',"VIA CAR
View bussgroups
- name: ACTIVE DIR PROD
uid: ACTIVE DIR PROD_APPL
type: APPLICATION
primarySource:
- probe
filtered: true
transactions:
- name: All other
uid: All other_TRANS_ACTIVE DIR PROD
filtered: true
View Bershka.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josecolella
josecolella / pre-render.js
Created Jul 9, 2017 — forked from mef/pre-render.js
proof-of-concept pre-rendering d3.js svgs on the server using node.js and jsdom module.
View pre-render.js
// pre-render d3 charts at server side
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
jsdom.env({
features : { QuerySelector : true }
, html : htmlStub
, done : function(errors, window) {
View gist:aafc9bc4b9a27cbfcf7b28dbe48e2477
makebond() {
BOND=$1
SLAVE1=$2
SLAVE2=$3
IPADDRESS=$4
NETMASK=$5
GATEWAY=$6
_HOSTNAME=$(hostname)
@josecolella
josecolella / solution.py
Created Feb 17, 2017
Permutation Problem
View solution.py
#!/usr/bin/env python
def solution(N, S):
reserved_seats = S.split(" ")
seatMarkers= ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K']
count = 0
formatted = []
seats = []
# Creation of list of seats
for row in range(N):
@josecolella
josecolella / Prefereces.sublime-settings
Created Feb 2, 2017
Sublime Text 3 User Preferences
View Prefereces.sublime-settings
{
"always_show_minimap_viewport": true,
"auto_complete_triggers":
[
{
"characters": ".",
"selector": "source.python"
}
],
"bold_folder_labels": true,
You can’t perform that action at this time.