Skip to content

Instantly share code, notes, and snippets.

View ungoldman's full-sized avatar
🤔
💭

Nate Goldman ungoldman

🤔
💭
View GitHub Profile
@ungoldman
ungoldman / curl_post_json.md
Last active April 15, 2024 14:46
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@ungoldman
ungoldman / fizzbuzz.js
Created August 3, 2012 20:50
Quest for the Shortest FizzBuzz
for (var i=1;i<=100;i++){
var s = '';
if (i % 3 === 0) s += 'Fizz';
if (i % 5 === 0) s += 'Buzz';
console.log(s ? s : i);
}
@ungoldman
ungoldman / dokku_setup.md
Last active November 28, 2023 12:35
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is several years out of date! You probably shouldn't use it.

@ungoldman
ungoldman / computer-ethics.md
Last active September 14, 2023 09:18
Resources on Computer Ethics
@ungoldman
ungoldman / example.html
Created January 5, 2012 03:02
google maps example
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
#map_canvas {
height: 300px;
width: 300px;
}
@ungoldman
ungoldman / identify_intersections.ipynb
Created November 30, 2020 23:04 — forked from kuanb/identify_intersections.ipynb
Inspired by this Twitter thread, this is a DIY version to generate similar maps: https://twitter.com/82_Streetcar/status/1333076980032532480
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ungoldman
ungoldman / CHANGELOG.md
Last active November 23, 2020 17:39
change log template

${project-name} Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

1.0.0

  • engage
@ungoldman
ungoldman / findLocalItems.js
Last active November 20, 2020 04:05
how to filter keys from localStorage with a regex
// returns an array of localStorage items in key/value pairs based on a query parameter
// returns all localStorage items if query isn't specified
// query can be a string or a RegExp object
function findLocalItems (query) {
var i, results = [];
for (i in localStorage) {
if (localStorage.hasOwnProperty(i)) {
if (i.match(query) || (!query && typeof i === 'string')) {
value = JSON.parse(localStorage.getItem(i));
@ungoldman
ungoldman / index.html
Last active August 23, 2020 14:27
table grid example
<!DOCTYPE html>
<html lang="en" class="element">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>grid experiment</title>
<link rel="stylesheet" href="https://elementcss.neocities.org/dist/element-0.0.1.min.css">
<style>
table { width: 100%; table-layout: fixed; }
@ungoldman
ungoldman / choo-store.js
Last active July 24, 2018 09:24
sketch of a simple wrapper for predictable, namespaced choo stores
/*
Now a real module used in production!
https://github.com/ungoldman/choo-store
*/
class Store {
constructor (opts) {
opts = opts || {}