Skip to content

Instantly share code, notes, and snippets.

Avatar

John Santiago Jr. jdsantiagojr

View GitHub Profile
@jdsantiagojr
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",
View map.py
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;
}
View delete-branch.sh
git push origin --delete <branch_name>
git branch -d <branch_name>
@jdsantiagojr
jdsantiagojr / gist.md
Created Dec 25, 2016 — forked from benbalter/gist.md
Example of how to embed a Gist on GitHub Pages using Jekyll.
View gist.md

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: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@jdsantiagojr
jdsantiagojr / AWS-Lambda-HTML.md
Created Mar 6, 2017
AWS HTML Lambda Settings
View AWS-Lambda-HTML.md

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
jdsantiagojr / ha-proxy-stats.py
Last active Jul 21, 2017
HAProxy stats CSV to JSON
View ha-proxy-stats.py
#!/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
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(`http://api.openweathermap.org/data/2.5/weather?zip=${event.zip}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.