Skip to content

Instantly share code, notes, and snippets.

View chase2981's full-sized avatar

Chase Gibbons chase2981

View GitHub Profile
@chase2981
chase2981 / Sierra.md
Created November 26, 2021 07:47 — forked from miku/Sierra.md
MacOS Sierra App Store Link
@chase2981
chase2981 / reset_osx_attributes.sh
Created November 19, 2021 07:27 — forked from kennwhite/reset_osx_attributes.sh
Remove all extended attributes recursively on an OSX directory & files and fix "chown: ... Operation not permitted" and "chmod: ... Operation not permitted"
# This is the nuclear option. Use with extreme care
# Works up to and including Mountain Lion (10.8.x)
# Show all extended attributes
ls -lOe ~/dir-to-fix
# Remove no-change attributes
sudo chflags nouchg ~/dir-to-fix
# Recursively clear all entended attributes
test
@chase2981
chase2981 / MacUbuntu.txt
Created September 20, 2021 23:23
Mac Ubuntu Setup
https://laptop.ninja/how-to-install-ubuntu-on-a-macbook-pro/
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 / 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
@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_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 / 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 / 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