Skip to content

Instantly share code, notes, and snippets.

View chase2981's full-sized avatar

Chase Gibbons chase2981

View GitHub Profile
/*
Solution of: https://www.codewars.com/kata/545434090294935e7d0010ab
*/
var query = function() {
var self = {};
var tables = [];
var selector = null;
@chase2981
chase2981 / gist:94ab619a59cf031703b2888a9d4098b1
Created March 30, 2020 04:59 — forked from CrookedNumber/gist:8964442
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

@chase2981
chase2981 / wifiscanner.py
Created November 4, 2020 04:23 — forked from dropmeaword/wifiscanner.py
A simple python script which records and logs wifi probe requests.
#########################################################################
# Wifiscanner.py - A simple python script which records and logs wifi probe requests.
# Author - D4rKP01s0n
# Requirements - Scapy and Datetime
# Inspiration - Tim Tomes (LaNMaSteR53)'s WUDS https://bitbucket.org/LaNMaSteR53/wuds/
# Reminder - Change mon0 (around line 65) to your monitor-mode enabled wifi interface
#########################################################################
from datetime import datetime
{
"Africa/Abidjan": "+00:00",
"Africa/Accra": "+00:00",
"Africa/Addis_Ababa": "+03:00",
"Africa/Algiers": "+01:00",
"Africa/Asmara": "+03:00",
"Africa/Asmera": "+03:00",
"Africa/Bamako": "+00:00",
"Africa/Bangui": "+01:00",
"Africa/Banjul": "+00:00",
@chase2981
chase2981 / docusaurus-copy-button.md
Created February 26, 2021 02:54 — forked from yangshun/docusaurus-copy-button.md
How to add the "Copy" button to code blocks in Docusaurus

Adding "Copy" (to Clipboard) Button

If you would like to add a button to your fenced code blocks so that users may copy the code, you can do so in Docusaurus. You will have to add some code to your Docusaurus project, as seen below.

Under static/js, create a file called code-block-buttons.js with the following:

// Turn off ESLint for this file because it's sent down to users as-is.
/* eslint-disable */
window.addEventListener('load', function() {
@chase2981
chase2981 / rxjs-diagrams.md
Created April 13, 2021 18:44 — forked from PCreations/rxjs-diagrams.md
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@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