Skip to content

Instantly share code, notes, and snippets.

View ogranada's full-sized avatar

Oscar Andres Granada Baquro ogranada

  • Colombia
View GitHub Profile
@ogranada
ogranada / Set up GitHub push with SSH keys.md
Last active June 25, 2021 03:47 — forked from xirixiz/Set up GitHub push with SSH keys.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
@ogranada
ogranada / server.js
Created July 2, 2019 20:05 — forked from ryanoglesby08/server.js
A node.js SPA server that serves static files and an index.html file for all other routes.
/*
Incredibly simple Node.js and Express application server for serving static assets.
Given as an example from the React Router documentation (along with examples
using nginx and Apache):
- https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory
*/
const express = require('express');
const path = require('path');
@ogranada
ogranada / passport.js
Created January 15, 2016 00:57 — forked from manjeshpv/passport.js
Passport.js using MySQL for Authentication with Express
// config/passport.js
// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
@ogranada
ogranada / watcher.py
Created November 7, 2015 01:10 — forked from mjallday/watcher.py
File watcher in Python
#!/bin/python
"""
A simple directory watching script that will compute the checksum for all files
within a path and execute a change when the sum changes.
This will not work well with large files as it reads the entire file into
memory.
"""
import argparse
@ogranada
ogranada / echoHttpRequest.js
Last active August 29, 2015 14:21 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);