Skip to content

Instantly share code, notes, and snippets.

View kjr247's full-sized avatar

Kyle Rebstock kjr247

View GitHub Profile
@kjr247
kjr247 / setupGitConfigAlias.bash
Created April 8, 2020 16:48
setupGitConfigAlias.bash
echo https://koukia.ca/personalizing-git-aliasing-commands-4dda73b54081
echo https://thoughtbot.com/blog/streamline-your-git-workflow-with-aliases
git config --global alias.alias "! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ /"
git config --global alias.cob "checkout -b"
git config --global alias.c "commit -m"
git config --global alias.a '!git add . && git status'
git config --global alias.p '!git push origin && git status'
git config --global alias.s "status"
@kjr247
kjr247 / .gitconfig
Last active March 28, 2023 21:48
git aliases
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = Kyle Rebstock
email = kjr247@gmail.com
[alias]
a = !git add . && git status
@kjr247
kjr247 / cloudSettings
Created May 11, 2018 15:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-05-11T15:29:16.654Z","extensionVersion":"v2.9.2"}
@kjr247
kjr247 / find deeply nested value of undefined
Created October 14, 2017 20:21
This is a first draft crack at traversing a tree looking for undefined. Could definitely be more performant, but it works for what I need.
function filterDeep(humans) {
return humans.map((val, key) => {
if(Array.isArray(val)) {
filterDeep(val);
} else if(typeof val === "object") {
filterDeep(Object.values(val));
} else if (val === undefined) {
console.log(typeof val, val, key);
return true;
}
@kjr247
kjr247 / redux saga boilerplate
Created October 3, 2017 23:38
An abstraction that turns boilerplate of the service calls in redux saga into one liners. I like how this keeps me moving quickly because I don't have to create a new action type for each new service call. Although it is always nice to those prevent typos. XD
import { call, put } from "redux-saga/es/effects";
const RequestActionTypes = {
COMPLETED: "@REQUEST/COMPLETED",
PENDING: "@REQUEST/PENDING",
STARTED: "@REQUEST/STARTED"
};
const isSuccessful = (result) => get(result, "data.status", false) && hasData(result);
@kjr247
kjr247 / gist:10503476
Created April 11, 2014 21:35
pascal compiler in C++ allowing concurrency without using semaphores
Kyle Rebstock <kjr247@gmail.com> Fri, Apr 11, 2014 at 1:10 PM
To : Kyle Rebstock <kjr247@gmail.com>
// -------------------------------------------
// Program: pascomp.cc (Version 1.8)//modified since 1.8 This is compiler before val/ref feature
//
// Description: This is a pascal like compiler with low-level code implementation.
// Student: Kyle Jackson Rebstock
// ID: 713599
// Date: February 8, 2014
@kjr247
kjr247 / fibopthread.cpp
Created October 19, 2013 00:56
Pthreads to spawn a child process and print the Fibonacci sequence (http://en.wikipedia.org/wiki/Fibonacci_number) up to a user specified number of places. You do actually have to COMPUTE the sequence, not just print it out from a hardcoded value. ou should divide the sequence roughly in half (if the user inputs an even number, one half - doesn'…
#include <pthread.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int i, var1, var2;
int inputsize=0;
int fibarray[100];