Skip to content

Instantly share code, notes, and snippets.

View justgage's full-sized avatar

Gage Peterson justgage

View GitHub Profile
@justgage
justgage / stuff-we-miss-out.md
Created May 12, 2017 18:44
React stuff we miss out on

15.5.4 (April 11, 2017)

React Addons

Critical Bugfix: Update the version of prop-types to fix critical bug. (@gaearon in 545c87f) Fix react-addons-create-fragment package to include loose-envify transform for Browserify users. (@mridgway in #9642) React Test Renderer

Fix compatibility with Enzyme by exposing batchedUpdates on shallow renderer. (@gaearon in #9382)

@justgage
justgage / HowToElm.md
Last active January 17, 2020 23:49
How To Elm

How to Elm

This is a basic guide on how to learn Elm rather than actually teach you. I'm going to mostly link to resources that I feel are valuable and try to "teach you how to fish".

The main purpose is to accelerate your learning and save you a lot of googling and weeding through bad explinations.

Essential links

@justgage
justgage / ResultValue.rb
Created January 16, 2017 20:25
A simple result monad in ruby
# This class helps to captue possible errors as a value. While you could capture these conditions as
# `nil` it's easy to forget to check for it everywhere.
#
# ResultValue helps with this by making the only way to get at the value is with #case_of.
class ResultValue
# This will rescue any exceptions and return it as an "errored" ResultValue
# if there was none it will return it as an "ok" ResultValue with the value
# wrapped inside
def self.capture_result
@justgage
justgage / TakeingForGranted.md
Created October 18, 2016 04:32
Summary of "O How Great the Plan of Our God! By President Dieter F. Uchtdorf"

Do We Take Spiritual Truths for Granted?

From this talk by President Dieter F. Uchtdorf

Life-changing truths are before our eyes and at our fingertips, but sometimes we sleepwalk on the path of discipleship ... We tread a path covered with diamonds, but we can scarcely distinguish them from ordinary pebbles.

In what ways do we take spiritual things for granted?

  • Scriptures (don't read them as much as we should considering what they are)
  • Prayers (forget who we're talking to, too much a rush)
@justgage
justgage / myShell.cpp
Created May 17, 2016 06:36
A simple Linux shell
/***********************************************************************
* Program:
* Lab UnixShell
* Brother Jones, CS 345
* Author:
* Gage Peterson
* Summary:
* This is a tiny unix shell made for my operating systems class
************************************************************************/
@justgage
justgage / gage-lab00.cpp
Created April 20, 2016 01:54
A program to prove that I can C++
/***********************************************************************
* Program:
* Lab 00, Practice Lab Submission
* Brother Jones, CS345
* Author:
* Gage Peterson
* Summary:
* This is the first lab. It will count the number of lines the user
* enters that begin a capital letter
************************************************************************/
...
type: 7
player
Score: 0
numLives: 3
about to reset state
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef95f700 (LWP 26178)]
0x0000000000403aad in std::__cxx11::list<GameObject*, std::allocator<GameObject*> >::begin (this=0x0)
package main.scala
object HelloWorld {
def hello(name: String = "World") = "Hello, " + name;
// sudo tests
def main(args: Array[String]):Unit = {
println(hello())
println(hello("Gage"))
}
@justgage
justgage / rock_paper_sinners.rs
Created October 29, 2015 23:38
An implementation of rock, paper, scissors that mostly cheats. (part 1)
use std::io;
use std::io::Write;
fn prompt() -> String {
let input = io::stdin();
println!("Welcome to Rock, Paper, and Sinners!");