Skip to content

Instantly share code, notes, and snippets.

@rhettc
rhettc / async_await_best_practices_cheatsheet.md
Created September 20, 2019 20:18 — forked from jonlabelle/async_await_best_practices_cheatsheet.md
C# Asynchronous Programming Guideline Cheat Sheet

Async Await Best Practices Cheat Sheet

Summary of Asynchronous Programming Guidelines

Name Description Exceptions
Avoid async void Prefer async Task methods over async void methods Event handlers
Async all the way Don't mix blocking and async code Console main method
Configure context Use ConfigureAwait(false) when you can Methods that require con­text
@rhettc
rhettc / query_examples.sql
Created May 7, 2020 12:52 — forked from markwhat1/query_examples.sql
Open Dental Query Examples
This file has been truncated, but you can view the full file.
Home Welcome to the Open Dental Query Examples Page
These query examples were written for other practices, usually for a specific purpose. There may be additional changes needed to return the results you want.
Queries are sorted chronologically, with queries written for older versions listed first and queries written for newer versions listed last.
We recommend looking at higher numbered queries first, because older queries may not work in new versions.
If you find a query you like, copy/paste the query into Open Dental to run it. See User Queries
If needed, change
any required variables before running. Look at the query comments for variable descriptions.
@rhettc
rhettc / query_examples.sql
Created May 7, 2020 12:52 — forked from markwhat1/query_examples.sql
Open Dental Query Examples
This file has been truncated, but you can view the full file.
Home Welcome to the Open Dental Query Examples Page
These query examples were written for other practices, usually for a specific purpose. There may be additional changes needed to return the results you want.
Queries are sorted chronologically, with queries written for older versions listed first and queries written for newer versions listed last.
We recommend looking at higher numbered queries first, because older queries may not work in new versions.
If you find a query you like, copy/paste the query into Open Dental to run it. See User Queries
If needed, change
any required variables before running. Look at the query comments for variable descriptions.
@rhettc
rhettc / reclaimWindows10.ps1
Last active November 6, 2019 00:50 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@rhettc
rhettc / Puzzle.ino
Last active May 11, 2016 22:13
Extract Method
void setupButton(int pin, Bounce debouncer)
{
pinMode(pin, INPUT_PULLUP);
// configure the de-bounce for this button
debouncer.attach(pin);
debouncer.interval(5);
}
void setup() {
@rhettc
rhettc / with-block.hbs
Created December 18, 2013 17:40
Yay - with blocks
When you're dealing with nested properties, a with block can define a context so that you don't have to write out the full dotted path.
The example below shows that inside the block we can directly access the properties of the book like title without typing book.title.
This is one of my favorite bits of syntactic sugar from VB.NET, glad to see it here.
{{#with book}}
<div class=”book”>
<h1>{{title}}</h1>
{{author}}<br />
{{text}}</p>
</div>
@rhettc
rhettc / ember-sample.js
Last active December 30, 2015 23:39
A look at controllers and templates
// Establishing routes
<script type="text/javascript">
Notes.Router.map(function () {
this.resource('notes', {path: "/"}, function() {
this.route('note', {path: "/note/:note_id"});
});
});
Notes.NotesRoute = Ember.Route.extend({
// Note here where we are "setting the subject for the index action"
@rhettc
rhettc / gitconfig
Created June 5, 2013 20:12
git color config
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
MAKEDEV.i686 3.24-6.6.amzn1 installed
PyYAML.i686 3.09-5.5.amzn1 installed
acl.i686 2.2.49-4.8.amzn1 installed
acpid.i686 1.0.10-2.1.6.amzn1 installed
alsa-lib.i686 1.0.21-3.8.amzn1 installed
apr.i686 1.3.9-3.8.amzn1 @amzn-main
apr-devel.i686 1.3.9-3.8.amzn1 @amzn-main
apr-util.i686 1.3.9-3.9.amzn1 @amzn-main
apr-util-ldap.i686 1.3.9-3.9.amzn1
@rhettc
rhettc / gist:ba33e5b58b2dcf0c0c04
Created November 17, 2014 22:15
use find to duplicate the parent directory’s structure into the current directory, files are not copied
# given the structure
../foo/bar
../fizz/bang
../beep
# move into the beep child dir and run the command
cd beep
find ../ -mindepth 1 -type d -printf "%P\0" | xargs --null mkdir
# now beep has the same structure
./foo/bar
./fizz/bang