Skip to content

Instantly share code, notes, and snippets.

@haipeng
haipeng / README.md
Created November 25, 2021 08:45 — forked from qti3e/README.md
List of file signatures and mime types based on file extensions
@haipeng
haipeng / Common-Currency.json
Created March 12, 2021 03:13 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@haipeng
haipeng / extract-source-from-source-map.ts
Created December 17, 2020 08:51 — forked from banyudu/extract-source-from-source-map.ts
Extract source code from source map
#!/usr/bin/env ts-node
import * as fs from 'fs'
import * as path from 'path'
import { promisify } from 'util'
import { SourceMapConsumer } from 'source-map'
const writeFile = promisify(fs.writeFile)
const mapFile = process.argv[2]
@haipeng
haipeng / simple_args_parsing.sh
Created September 28, 2018 02:35 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@haipeng
haipeng / nginx.conf
Created October 8, 2016 03:45 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support;
#
# A limitation to this method is that Nginx doesn't currently send headers