Skip to content

Instantly share code, notes, and snippets.

View jonyeezs's full-sized avatar
💼
Focusing on work - maybe slow to respond

Jonathan Yee jonyeezs

💼
Focusing on work - maybe slow to respond
View GitHub Profile
@jonyeezs
jonyeezs / .gitconfig
Last active June 21, 2022 02:23
My git config settings
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = YourName
email = test@test.com
# This is Git's per-user configuration file.
[merge]
tool = meld
conflictstyle = diff3
[core]
@jonyeezs
jonyeezs / Program.cs
Last active August 16, 2016 05:45
CSharpAsyncAwait
public class Program
{
/* Demonstrate Async Await
* This is a good starting point to understand async: http://blog.stephencleary.com/2012/02/async-and-await.html
* Slightly confuse between Task and Thread?: https://youtu.be/No7QqSc5cl8
* Here's some good videos:
* * Task Parallel Library - https://youtu.be/gfkuD_eWM5Y
* * Async & Await - https://youtu.be/DqjIQiZ_ql4
* Bad Practice:
* Don't use Wait() use await
@jonyeezs
jonyeezs / SerialHttpCalls.js
Last active November 18, 2016 01:52
How to chain promises that are built dynamically
/* Context:
* We are building an array of http calls that needs to be run synchronously (ie in serial).
* We have no idea how many calls we need to make so we have to go through an array but not have it run async.
*
* What's Involve:
* - angular's $http & $q to deal with promises, so we can resolve the calls when we want to.
* See: http://www.codelord.net/2015/09/24/$q-dot-defer-youre-doing-it-wrong/
* - Array.reduce to cascade down the array, with knowing the current and next value.
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
* - Lodash to do collection manipulation for us.
@jonyeezs
jonyeezs / .gitignore
Last active April 16, 2016 06:55
My global gitignore
# Referencing to https://gist.github.com/octocat/9257657#
# Compiled source #
###################
*.com
*.class
# *.dll - some work projects do want to include this
# *.exe - some work projects do want to include this
# *.o
# *.so