Skip to content

Instantly share code, notes, and snippets.

View tehpsalmist's full-sized avatar
🚑
move things and breakfast

Ben Steward tehpsalmist

🚑
move things and breakfast
View GitHub Profile
@alexweber
alexweber / create-plugin.js
Last active August 14, 2018 00:24
create plugin script
'use strict';
const requestify = require('requestify');
const homedir = require('os').homedir();
const cfg = require(homedir + '/.maya/mayarc.json');
// Load default dev token and namespace prefix from glboal user config.
const token = cfg.token;
const prefix = cfg.prefix;
@bubblerun
bubblerun / array.js
Created January 17, 2017 02:37
State abbreviations JavaScript array
[ 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY' ];
@soheilhy
soheilhy / nginxproxy.md
Last active October 23, 2024 08:19
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@dtx
dtx / HashMap.js
Created September 27, 2012 00:11
A simple HashMap implementation in Javascript, just something I wrote while reading DailyJS.
var HashMap = function(){
this._size = 0;
this._map = {};
}
HashMap.prototype = {
put: function(key, value){
if(!this.containsKey(key)){
this._size++;