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
#!/bin/bash
function confirm(){
printf "$1 [y/N] "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
return 1
;;
*)
/* BEM
> Block Element Modifier
> http://getbem.com/
*/
.Card__extra-button--active {
font-weight: bold;
}
.Card--link {
text-decoration: none;
}
.header .card .content ul li a {
text-decoration: none;
}
@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');
const readline = require('readline');
const prompt = (message, defaultValue) => {
return new Promise((resolve, reject) => {
const rl = readline.createInterface({
output: process.stdout,
input: process.stdin
});
rl.question(message, (res) => {
resolve(res||defaultValue);
@ogranada
ogranada / base.js
Last active February 4, 2019 22:31
(function(){
const consoles = document.querySelectorAll('.Console');
if(consoles.length < 1) {
const cle = document.createElement('pre');
cle.classList.add('.Console');
document.body.appendChild(cle);
window.log = (...data) => {
cle.innerHTML += `\n${data.join(' ')}`;
};
FROM nginx
VOLUME ["/opt/certificates", "/etc/nginx/conf.d"]
RUN apt-get update && apt-get -y install python3 # Have python3 available
COPY nginx.conf /etc/nginx/nginx.conf
COPY config /etc/nginx/config
COPY conf.d /etc/nginx/conf_base
@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',