Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffery Bennett Meandmybadself

View GitHub Profile
@skylineproject
skylineproject / monitor.js
Created Dec 1, 2020
Basic process monitor
View monitor.js
const { spawn } = require("child_process");
const COMMAND = "ls"
const ALLOWED_REBOOTS = 10
async function main() {
console.log("Starting process");
let counter = 0;
let failed = false;
let handle;
@abatko
abatko / US Zip Code Geolocations from 2018 Government Data
Last active Nov 29, 2021
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
View US Zip Code Geolocations from 2018 Government Data
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
@croaky
croaky / App.tsx
Last active Jul 25, 2021
Parcel + TypeScript + React
View App.tsx
import * as React from 'react'
// routing, etc.
import { Reset } from '~/ui/shared/Reset'
export class App extends React.Component {
public render() {
return (
<div>
<title>Dashboard</title>
@ndbroadbent
ndbroadbent / .dev.scpt
Last active Mar 14, 2021
Using AppleScript to set up iTerm2 tabs and panes for Rails development
View .dev.scpt
# iTerm2 AppleScript Docs: https://www.iterm2.com/documentation-scripting.html
on run argv
set current_dir to item 1 of argv
tell application "iTerm2"
tell current window
set rails_session to current session
set current_tab to current tab
tell current session
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active Dec 1, 2021
Install Nginx on Mac OS from source (without brew)
View install_nginx_macos_source.md

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@skylineproject
skylineproject / clean-react-native-app.sh
Last active Jan 7, 2019
A quick helper util for getting a misbehaving React Native environment back to normal.
View clean-react-native-app.sh
alias clean-rn="watchman watch-del-all && rm -fr $TMPDIR/npm* && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && yarn cache clean && rm -rf ios/build && rm -rf ios/Pods && rm -rf android/.gradle && rm -rf android/.idea && rm -rf android/build && rm -rf android/app/build && rm -rf android/app/app.iml && yarn"
@kydouglas
kydouglas / elk.sh
Last active Nov 8, 2021 — forked from abhishektomar/elk.sh
Bash Script to Install Elastic Search, Logstash and Kibana
View elk.sh
#!/bin/bash
#ONE LINE
#sudo wget -Nnv 'https://gist.githubusercontent.com/kydouglas/1f68d69e856fd6d7dc223f8e1f5ae3b3/raw/f8c3b22b9d9c41093150b96c815776956b523d9d/elk.sh' && bash elk.sh && rm -f elk.sh
# Checking whether user has enough permission to run this script
sudo -n true
if [ $? -ne 0 ]
then
echo "This script requires user to have passwordless sudo access"
@greencoder
greencoder / apns.sh
Created May 11, 2016
Curl the APNS http/2 API
View apns.sh
# Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \
https://api.development.push.apple.com/3/device/<device token>
@markhowellsmead
markhowellsmead / array_find.js
Created Apr 20, 2016
Polyfill JavaScript Array.prototype.find for older browsers (e.g. IE 10, IE 11)
View array_find.js
if (!Array.prototype.find) {
Array.prototype.find = function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
@mralexho
mralexho / setup-dev.sh
Last active Nov 3, 2020
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
View setup-dev.sh
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php