Skip to content

Instantly share code, notes, and snippets.

@derekedelaney
derekedelaney / web-servers.md
Created July 1, 2016 17:43 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

The MIT License (MIT)

Copyright (c) 2015

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@derekedelaney
derekedelaney / README-Template.md
Created May 16, 2017 03:24 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@derekedelaney
derekedelaney / Markdown help
Last active June 14, 2017 16:46
markdown help
[Markdown Help](https://guides.github.com/features/mastering-markdown/)
git commit -am $(echo generated: $(curl -s http://whatthecommit.com/index.txt))
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// add additional config below
summon: {
hotkey: 'Alt+Space'
@derekedelaney
derekedelaney / lodashGetAlternative.js
Created November 27, 2017 16:46 — forked from jeneg/lodashGetAlternative.js
Alternative to lodash get method _.get()
function get(obj, path, def) {
var fullPath = path
.replace(/\[/g, '.')
.replace(/]/g, '')
.split('.')
.filter(Boolean);
return fullPath.every(everyFunc) ? obj : def;
function everyFunc(step) {
@derekedelaney
derekedelaney / zip.py
Created January 12, 2018 23:12
zip a folder
# zips a folder
import os
import sys
import argparse
import zipfile
def zip(src, dst):
fname = "%s.zip" % (dst)
if os.path.exists(fname):
@derekedelaney
derekedelaney / s3_upload.js
Last active January 17, 2018 03:23
Uploads a folder and its content to an s3 bucket
/**
* Get variables from command line
*/
let cmd = {};
let args = ['command', 'file', 'bucket', 'src']
process.argv.forEach(function(val, index, array) {
if (array.length === 4) {
cmd[args[index]] = val;
}
});