Skip to content

Instantly share code, notes, and snippets.

View jechasteen's full-sized avatar

Jonathan Chasteen jechasteen

View GitHub Profile
@jechasteen
jechasteen / adjectives.txt
Last active April 17, 2022 13:01
2000+ newline-separated English adjectives in plain text
abandoned
abatic
abducent
abecedarian
aberrant
abeyant
abhorrent
abject
ablative
ablaze
@jechasteen
jechasteen / treeview.js
Created September 2, 2021 03:40
GJS/GTK 3.0 - Gtk.TreeView with TreeStore/TreeModel
// You have to tell GJS which version of Gtk to target
imports.gi.versions.Gtk = "3.0"
const { GObject, Gtk } = imports.gi;
Gtk.init(null);
class MyWindow extends Gtk.Window {
_init() {
super._init({
title: "My TreeView Example"
@jechasteen
jechasteen / dwm_bar_stats.sh
Created May 25, 2020 14:15
A simple status bar for dwm written in bash
#!/bin/env bash
# Refresh timer, seconds
REFRESH=5
# Weather - wttr.in/help
LOCALITY=45403
FORMAT=3
# unicode symbols/icons
@jechasteen
jechasteen / install_dotfiles.sh
Last active January 2, 2020 11:46
A quick script to install my dot files
#!/usr/bin/env bash
# Credit to the tutorial found at
# https://www.atlassian.com/git/tutorials/dotfiles
config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
git clone --bare https://github.com/jechasteen/dotfiles.git $HOME/.cfg && $config checkout
if [[ "$?" = 0 ]]; then
echo "Checked out dot files repo..."
! URxvt Settings
URxvt.termName: rxvt-256color
URxvt.iso14755: False
URxvt.saveLines: 9999
URxvt.scrollstyle: plain
URxvt.scrollBar_right: True
URxvt*scrollWithBuffer: True
URxvt*secondaryScreen: 1
URxvt*secondaryScroll: 0
URxvt.font: xft:hack:size=10
@jechasteen
jechasteen / euler_randomize.js
Created February 15, 2018 00:12
Redirects to a random Euler Problem
// To use, go to https://projecteuler.net/archives
// then open the developer console and paste the contents of this file
// This will automatically direct to a random problem.
function getTotalProbs(){
var p = document.querySelector( "p" ).textContent;
var total = "";
for ( var i = 0; i < p.length; i++ ) {
if ( p[i] === "1" ){
for ( var j = i + 5; p[j] != "."; j++ ) {
@jechasteen
jechasteen / functimer.js
Last active March 18, 2018 13:35
Times a function using a callback
// For use in Node.js
//const { performance } = require('perf_hooks')
function funcTimer(callback){
performance.mark('A')
var callbackReturn = callback();
performance.mark('B')
performance.measure('A->B', 'A', 'B')
const measure = performance.getEntriesByName('A->B')[0]
console.log(arguments.callee.name, 'execution took:', measure.duration, 'ms')