Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Rebstock kjr247

View GitHub Profile
@kjr247
kjr247 / setupGitConfigAlias.bash
Created Apr 8, 2020
setupGitConfigAlias.bash
View 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 Apr 10, 2020
git aliases
View .gitconfig
[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
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-05-11T15:29:16.654Z","extensionVersion":"v2.9.2"}
@kjr247
kjr247 / find deeply nested value of undefined
Created Oct 14, 2017
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.
View find deeply nested value of undefined
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 Oct 3, 2017
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
View redux saga boilerplate
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 Apr 11, 2014
pascal compiler in C++ allowing concurrency without using semaphores
View gist:10503476
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 Oct 19, 2013
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'…
View fibopthread.cpp
#include <pthread.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int i, var1, var2;
int inputsize=0;
int fibarray[100];
You can’t perform that action at this time.