Skip to content

Instantly share code, notes, and snippets.


John Santiago Jr. jdsantiagojr

View GitHub Profile
jdsantiagojr / Makefile
Last active Nov 22, 2016
Makefile generated by WinAVR
View Makefile
# Hey Emacs, this is a -*- makefile -*-
# WinAVR Makefile Template written by Eric B. Weddington, Jˆrg Wunsch, et al.
# Released to the Public Domain
# Additional material for this makefile was written by:
# Peter Fleury
# Tim Henigan
# Colin O'Flynn
View name-input.json
"prefixes": {
"Ms": "Ms",
"Miss": "Miss",
"Mrs": "Mrs",
"Mr": "Mr",
"Master": "Master",
"Rev": "Reverend",
"Fr": "Farther",
"Dr": "Doctor",
class Map(dict):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for arg in args:
if isinstance(arg, dict):
for k, v in arg.items():
self[k] = v
def __getattr__(self, item):
View text-overflow.css
p {
width: 200px;
border: 1px solid;
padding: 2px 5px;
/* Required for text-overflow */
white-space: nowrap;
overflow: hidden;
git push origin --delete <branch_name>
git branch -d <branch_name>
jdsantiagojr /
Created Dec 25, 2016 — forked from benbalter/
Example of how to embed a Gist on GitHub Pages using Jekyll.

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.

View 1-restify-server-cheatsheet.js
// Restify Server CheatSheet.
// More about the API:
// Install restify with npm install restify
// 1.1. Creating a Server.
var restify = require('restify');
jdsantiagojr /
Created Mar 6, 2017
AWS HTML Lambda Settings

Lambda HTML Response

Method Response

  1. Navigate to the Method Response for the API's GET method.
  2. Open up the 200 under HTTP Status and add a Response Header named Content-Type.
  3. Delete the application/json Response Model for 200.
jdsantiagojr /
Last active Jul 21, 2017
HAProxy stats CSV to JSON
#!/usr/bin/env python3
from csv import DictReader
from sanic import Sanic
from sanic.response import json
import aiohttp
import uvloop
# Create an event loop manually so that we can use it for both sanic & aiohttp
jdsantiagojr / lambda-example.js
Created Jul 20, 2017
Simple lambda handler example.
View lambda-example.js
"use strict";
const request = require("request");
exports.handler = function handler(event, context, callback)
request(`${}us&appid=287050e4a6505be74bfdc324567h&units=imperial`, (error, response, body) => {
if (!error) {
body = JSON.parse(body);
const payload = {
You can’t perform that action at this time.