Skip to content

Instantly share code, notes, and snippets.

View jiayun's full-sized avatar

Jiayun Zhou (Claudia) jiayun

View GitHub Profile
#!/usr/bin/env python3
from decimal import Decimal
import re
import yaml
from yaml.composer import Composer
from yaml.constructor import SafeConstructor
from yaml.parser import Parser
from yaml.reader import Reader
from yaml.resolver import BaseResolver, Resolver as DefaultResolver
@andrewglind
andrewglind / Main.kt
Last active December 3, 2018 16:02
Pass Node.js command-line args to Kotlin (JavaScript)
package blah
fun Main(args: List<String>) {
// ... your code goes here
}
external val process: dynamic
fun main(args: Array<String>) {
Main((process["argv"] as Array<String>).drop(2))
}
@branneman
branneman / lambda-img-to-webp.js
Created May 5, 2017 12:26
AWS Lambda@Edge whitelisted image to webp request mapper
'use strict';
const whitelist = {
'/static/img/photo.jpg': '/static/img/photo.webp'
};
exports.handler = (event, context, callback) => {
// Grab HTTP request and it's headers
const request = event.Records[0].cf.request;
@smarr
smarr / truffle-material.md
Last active May 9, 2024 08:19
Truffle: Languages and Material
@dstroot
dstroot / install_postgresql.sh
Created June 13, 2012 00:26
Install PostgreSQL on Amazon AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt