Skip to content

Instantly share code, notes, and snippets.

Avatar

John Santiago Jr. jdsantiagojr

View GitHub Profile
@sandcastle
sandcastle / redirect-ingress.yml
Created Aug 27, 2017
An example of a ingress redirect using kubernetes and nginx `configuration-snippet`
View redirect-ingress.yml
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: redirect-ingress
annotations:
ingress.kubernetes.io/configuration-snippet: |
if ($host ~ ^(.+)\.somedomain\.io$) {
return 301 https://$1.domain.io$request_uri;
}
spec:
@ndbroadbent
ndbroadbent / rn-i18n-locale-identifiers.csv
Last active Dec 20, 2020 — forked from jasef/ioslocaleidentifiers.csv
React Native i18n Locale Identifiers
View rn-i18n-locale-identifiers.csv
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@andyshinn
andyshinn / Dockerfile
Created Dec 24, 2015
BusyBox cron container example
View Dockerfile
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@drgarcia1986
drgarcia1986 / __main__.py
Last active Aug 25, 2020
Example of OAuth2 autentication server with Client Credentials grant (using python-oauth2 and tornado)
View __main__.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Diego Garcia'
import tornado.web
import tornado.ioloop
import oauth2.tokengenerator
import oauth2.grant
import oauth2.store.redisdb
import oauth2.store.mongodb
@youssman
youssman / regex-camelCase-to-dash.js
Created Nov 5, 2014
Javascript convert camelcase to dash (hyphen)
View regex-camelCase-to-dash.js
function camelCaseToDash( myStr ) {
return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase();
}
var myStr = camelCaseToDash( 'thisString' );
alert( myStr ); // => this-string
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');
@arvidfm
arvidfm / asyncio-tornado.py
Last active Dec 4, 2018
Running Tornado on asyncio's event loop, including 'yield from' support in request handlers
View asyncio-tornado.py
import asyncio
import tornado.concurrent
import tornado.ioloop
import tornado.web
import tornado.platform.asyncio
import tornado.httpclient
class ReqHandler(tornado.web.RequestHandler):
async def get(self):
@nisaacson
nisaacson / .tern-project
Created Feb 26, 2014
Use tern with vim for node.js development.
View .tern-project
{
"libs": [
"browser",
"underscore",
"jquery"
],
"plugins": {
"node": {}
}
}
@toolmantim
toolmantim / Makefile
Last active Jan 9, 2021
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
View Makefile
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
@murtaugh
murtaugh / cursor-reset.css
Last active Feb 17, 2020
CSS Cursor Reset
View cursor-reset.css
html,
body {
cursor: default;
}
code {
cursor: text;
}
/*
You can’t perform that action at this time.