Skip to content

Instantly share code, notes, and snippets.

View troy0820's full-sized avatar
💭
Thinking of a master plan....... 'Cause ain't nothin' but sweat inside my hand

Troy Connor troy0820

💭
Thinking of a master plan....... 'Cause ain't nothin' but sweat inside my hand
View GitHub Profile
@mjgil-gist
mjgil-gist / Git Aliases
Last active January 23, 2019 01:30 — forked from mjgil/Git Aliases
Git: Aliases
Taken from TJ Holowaychuk: http://tjholowaychuk.com/post/26904939933/git-extras-introduction-screencast
Added to ~/.bash_aliases
alias gd="git diff | subl"
alias ga="git add"
alias gaa="git add --all"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gm="git merge --no-ff"
@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing
#!/bin/sh
# install various tools and apps on a fresh Mac
# symlink dotfiles
source dotfiles.sh
# set mac defaults
source osxdefaults.sh
@mikermcneil
mikermcneil / query-multiple-models-in-sails-controller-action.js
Created September 16, 2015 19:05
Querying multiple models from a controller action in Sails
//...
showSchoolDetailPage: function (req, res) {
if (!req.param('id')) {
return res.badRequest('The id of the school (`id`) is a required parameter!');
}
// Look up the school, it's associated image, and the associated list of students.
School.findOne({
id: req.param('id')
@diegoconcha
diegoconcha / redux_egghead_notes.md
Last active January 18, 2022 13:23
Redux Egghead.io Notes

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@jamtur01
jamtur01 / pre-commit
Created October 18, 2016 21:54
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
@betaorbust
betaorbust / README.md
Last active July 21, 2018 19:57
ES2015 fallback check for Progressive Transpilation

ES2015 Syntax Check for use with Progressive Transpilation

The attached file file spits out a string for direct injection into the head of a page, which will be a lightweight test of the ability to parse and run ES2015 syntax.

Unminified version

This is the original source for the test-case below:

class ಠ_ಠ extends Array{

⚠️ this is now stupidly out of date

Computers

  • 13" Macbook Pro 3.3 GHz i7 (late 2016)
  • Microsoft Surface Book (2016)

Peripherals

@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()