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 / install-tmux
Last active Mar 15, 2016 — forked from rothgar/install-tmux
Install tmux 1.9 on rhel/centos 6
View install-tmux
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
View before.rb
def state
case
when !collected? then 'booked'
when !ironed? then 'collected'
when !delivered? then 'ironed'
else 'delivered'
end
end
View excpetions.rb
begin # start catching exceptions here
ldap = Net::LDAP.open(
:host => host,
:port => port,
:auth => {
:method => :simple,
:username => CONFIG['repldn'],
:password => CONFIG['replpw']
}
)
View bottomfeeder.rb
module Auspice
class BottomFeeder
attr_accessor :x, :y, :z, :in, :out
def initialize(size,w,h)
@font = Gosu::Font.new(size,:name => DAT+'ttfs/ATComputer.ttf')
@rows = ((h / size)+size)
@cols = (w / @font.text_width('_',1))
@size = size
@dtext = ['']
View gist:a4f7aa1f99ed1df07373
require 'io/console'
Kernel.load('Auspice/Auspice.rb')
module Auspice
class SplashScreen
def initialize
@win = Screen.new
#@sin = Gosu::Image.new(@win, Surface.new(64,64,[100,100,100,100]),false)
@words = BottomFeeder.new 24,800,400
#@gl = OpenGLInjection.new
#@win.addent(@gl)
View roadmap
I don't have a good name for it yet, webstorage git?
I want it to be kinda up-and-running for v0.1, so major sections are omitted intentionally.
basics:
config: object: key/val -> preference/state
{ 'branchname': 'master' }
tags: object: key/val -> tagname/(commit/tree/blob)hash
{ 'head': '' }
directory: object: key/val -> fullpathfilename/contents
{}
@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
View yardoc_cheatsheet.md

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
View rubyfy
def random_consonant
([*"b".."z"] - ["e", "i", "o", "u"]).sample
end
You can’t perform that action at this time.