Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View DTrejo's full-sized avatar

David Trejo DTrejo

View GitHub Profile
@mnemnion
mnemnion / git-move.sh
Created August 15, 2022 11:35
Move files from one git repo to another, following renames
#! /bin/bash
# Usage:
# ./git-move.sh path1/ path2/... path/to/destination/repo
args=("$@")
# All but last argument:
paths=("${args[@]::${#args[@]}-1}")
# Last argument:
dest="${args[${#args[@]}-1]}"
@abatko
abatko / US Zip Code Geolocations from 2018 Government Data
Last active March 31, 2024 21:18
All US zip codes with their corresponding geolocations (latitude and longitude coordinates). Comma delimited for your database goodness. Source: https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.html > ZIP Code Tabulation Areas > Download the ZIP Code Tabulation Areas Gazetteer File
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158327, -66.932928
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.447538, -66.557681
00622,17.991245, -67.153993
@StevenACoffman
StevenACoffman / git_jira_github_pull_request.sh
Last active August 20, 2021 04:11
Create Github pull request from JIRA and git
#!/bin/bash
function safe_curl() {
# call this with a url argument, e.g.
# safecurl.sh "http://eureka.test.cirrostratus.org:8080/eureka/v2/apps/"
# separating the (verbose) curl options into an array for readability
hash curl 2>/dev/null || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; }
hash jq 2>/dev/null || { echo >&2 "I require jq but it's not installed. Aborting."; exit 1; }
hash sed 2>/dev/null || { echo >&2 "I require sed but it's not installed. Aborting."; exit 1; }
require 'sinatra'
require 'infusionsoft'
require 'logger'
Infusionsoft.configure do |config|
config.api_url = 'XXXX.infusionsoft.com'
config.api_key = 'XXXXXXXXXXXXXXX'
config.api_logger = Logger.new("./infusionsoft_api.log")
end
require 'sinatra'
require 'infusionsoft'
require 'logger'
Infusionsoft.configure do |config|
config.api_url = 'XXXX.infusionsoft.com'
config.api_key = 'XXXXXXXXXXXXXXX'
config.api_logger = Logger.new("./infusionsoft_api.log")
end
@mikeal
mikeal / gist:8947417
Created February 12, 2014 00:27
NPM history.

[In reply to https://news.ycombinator.com/item?id=7219005]

Here's the history, hope it helps.

I wrote the original version of the npm registry in a day or two on top of CouchDB. I built it quickly and didn't think much about scale.

Isaacs continued to improve and maintain that code. At one point he even wrote up an open standard for generic js package registries for CommonJS but they didn't seem to care (they were too busy arguing about promises).

At the time I wrote the initial code I was employed at CouchOne and we had a small CouchDB hosting platform operated by Jason Smith which is where we ran the registry free of charge. Later on, after CouchOne was aquired by Membase and became Couchbase, it decided to break off the hosting company and give/sell it to Jason Smith, which became IrisCouch.

@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
@creationix
creationix / app.js
Last active December 30, 2015 07:29
Generate a tree of events using process.addAsyncListener
var http = require('http');
var send = require('send');
var urlParse = require('url').parse;
var count = 2;
var server = http.createServer(function (req, res) {
if (!--count) server.close(); // Only allow two connection and then exit.
send(req, urlParse(req.url).pathname)
.root(__dirname)
.pipe(res);
@creationix
creationix / app.js
Last active November 10, 2017 06:28
This is a science experiment showing how the new process.addAsyncListener API in node 0.12.x could be (ab)used to create a very easy to use web-framework.
module.exports = function () {
// If there is an uncaught exception anywhre in your app, it will result in a proper 500 page.
if (Math.random() < 0.3) throw new Error("Oops, my random is low");
// They don't have to happen in the first tick either
if (Math.random() < 0.2) return setTimeout(function () {
throw new Error("Delayed random bites");
});
// If you throw an object, it will send a JSON document to the client
if (Math.random() > 0.6) throw {Hello: request.url};
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/