Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominic Muller domgetter

  • Bakersfield, CA
View GitHub Profile
@domgetter
domgetter / RPNCalculator.java
Created Oct 12, 2017 — forked from StephenBerkner/RPN Calculator
Reverse Polish Notation Calculator Written in Java
View RPNCalculator.java
import java.util.*;
public class RPNCalc {
private static Stack<Integer> stack = new Stack<Integer>();
private static Scanner input = new Scanner(System.in);
public static void calculator() throws Exception {
System.out.println("Welcome to the RPN Calculator program!");
@domgetter
domgetter / gist:fbc4b99b80f13da4f45e5321b99ad3fd
Created Jun 10, 2020
Chrome highlight search scroll setting fragments
View gist:fbc4b99b80f13da4f45e5321b99ad3fd
Enable Text Fragment Anchor
This is the setting in chrome://flags to disable the asinine highlighting and auto-scrolling of search results AFTER you click them. What were they thinking??
@domgetter
domgetter / instruction.md
Created Aug 2, 2019
Readable Twitch chat
View instruction.md

Chrome

  • Download the Stylus extension (custom CSS)
  • Download the Tampermonkey extension (custom JS)
  • In Stylus, create a style for twitch.tv, and copy the stylus_chrome.css lines into it, and click save
  • In Tampermonkey, "Create a new script..." and copy the tampermonkey_chrome.js lines into it, and click File->Save (in Tampermonkey on the top left)
  • Refresh the twitch page, and chat should now look a lot better.

Firefox

@domgetter
domgetter / git_objects.rb
Last active Feb 17, 2019 — forked from anonymous/git_blob.rb
An implementation of different objects in the object store of Git
View git_objects.rb
require 'digest/sha1'
require 'zlib'
require 'pp'
module Git
OBJECTS = {}
class Object
@domgetter
domgetter / useful.txt
Created Jan 2, 2019
maybe worth looking at first sentence of man page
View useful.txt
[
2to3
apt
ar
arch
as
at
atq
atrm
awk
View segfault_or_something.rb
# running this in irb in tmux on WSL on Windows 10 (then you have to ctrl-c) causes segfault
# ruby version ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
# /etc/lsb-release
#DISTRIB_ID=Ubuntu
#DISTRIB_RELEASE=16.04
#DISTRIB_CODENAME=xenial
#DISTRIB_DESCRIPTION="Ubuntu 16.04.5 LTS"
def gen(r); o = ->(n) { n == 1 ? 1 : r**(n-1) + r*(-> o {o[r**(n-1)]}[o])}; end
two = gen(2)
two[2]
View 2017-09-16_r01_self_v_crane_many_springs.pgn
[Event "MANY SPRINGS 104 (201709160932)"]
[Site "North Richland Hills Library"]
[Date "2017.09.16"]
[Round "2"]
[White "Muller"]
[Black "Crane"]
[Result "0-1"]
[WhiteElo "Unrated"]
[BlackElo "1523"]
[ECO ""]
View core_with_chunks.clj
(ns mandelclj.core
(:gen-class)
(:import
(sun.java2d SunGraphics2D)
(javax.swing JFrame JLabel)
(java.awt.image BufferedImage)
(java.awt Dimension Color Rectangle)
(java.awt.event ActionEvent
ActionListener
MouseAdapter
View functional_programming_vocabulary.md

Vocabulary of functional programming

  • first-class function
    • when you can store a function in a variable
  • anonymous function
    • a function without a name
  • closures and pure functions
    • closure - function with at least one free variable (variable defined elsewhere)
    • pure function - a function where the variables are bound to the function's scope
      • also, a function that always returns the same output for some input
You can’t perform that action at this time.