Skip to content

Instantly share code, notes, and snippets.

View chase2981's full-sized avatar

Chase Gibbons chase2981

View GitHub Profile
@chase2981
chase2981 / forever-config.json
Created June 7, 2021 01:27 — forked from mrister/forever-config.json
Forever example with config file
{
// Sample configuration for app in /home/myuser/app dir
"uid": "app",
"max": 5, // restart the app successively maximum of 5 times
"spinSleepTime": 1000, // time to wait until a next restart is attempted (in ms)
"append": true, // append the logs, do not overwrite
"watch": true, // watch for changes and restart if they occur
"script": "server.js", // main startup script (almost like issuing node server.js)
"sourceDir": "/home/myuser/app", // the dir where your entire app code resides (dir structure is recursively traversed)
"args": ["--myAPIKey", "xBlzdn84fa"] // pass any arguments to your app
@chase2981
chase2981 / order_by_ignoring_null.py
Created August 18, 2021 21:34 — forked from yosemitebandit/order_by_ignoring_null.py
an example of ordering a Django queryset while ignoring null values
"""Order a queryset by last_active and make null values sort last."""
import datetime
from django.db.models.functions import Coalesce
from app import models
# Coalesce works by taking the first non-null value. So we give it
@chase2981
chase2981 / sky_tp_link.md
Created August 30, 2021 06:08 — forked from henrik/sky_tp_link.md
"Self-assigned IP" error with TP-link and Sky on OS X. #googlefood
@chase2981
chase2981 / get_latest_release.sh
Created September 9, 2021 22:57 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@chase2981
chase2981 / versioning.sh
Created September 9, 2021 23:20 — forked from MacLemon/versioning.sh
Autoincreasing Build numbers, get version numbers from git tag, put it into Info.plist
#!/bin/bash
# by Andreas Monitzer (@anlumo1) and Pepi Zawodsky (@MacLemon)
#
# This script published under WTF license
# http://en.wikipedia.org/wiki/WTFPL
# Improvements to this script are welcome though.
# Augments the Info.plist with a lot of nice stuff.
# It's suggested to call this script from a "run script" build phase, not copy the script's contents there.
@chase2981
chase2981 / get-latest-tag-on-git.sh
Created September 9, 2021 23:41 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
import React, { Component, createElement } from "react";
import Enzyme, { shallow, render, mount } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import { action, observable, computed } from "mobx";
import { observer } from "mobx-react";
Enzyme.configure({ adapter: new Adapter() });
class Store {
@observable val = 0;
}
@chase2981
chase2981 / MacUbuntu.txt
Created September 20, 2021 23:23
Mac Ubuntu Setup
https://laptop.ninja/how-to-install-ubuntu-on-a-macbook-pro/
test