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
@markwhat1
markwhat1 / query_examples.sql
Last active July 28, 2023 15:34
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.
If you need help finding a query, modifying a query, or would like a custom query, fill out and submit a Query Request Form
@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
import sys
import requests, bs4
import json
from collections import namedtuple
JishoSentence = namedtuple('JishoSentence', ['jp', 'en'])
JishoLookup = namedtuple('JishoLookup', ['json', 'sentences'])
def ac_text(action, params):
json_ins = None
@jonlabelle
jonlabelle / async_await_best_practices_cheatsheet.md
Last active February 28, 2024 11:32
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
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(200, PIN, NEO_GRB + NEO_KHZ800);
uint16_t pos = 0;
int tail = 20;
void setup() {
@rhettc
rhettc / pgactivity
Created April 16, 2014 23:37
Show open connections to databases in a brief format conducive to CLI usage
SELECT procpid as pid,
usename as user,
datname as db,
application_name as app, waiting as wait, current_query as query
FROM pg_stat_activity
WHERE datname <> 'postgres';
@rhettc
rhettc / .pryrc
Last active August 29, 2015 13:56
def app_path
unless @app_path
git_root = `git rev-parse --show-toplevel`.chomp
@app_path = $?.success? ? git_root : Dir.pwd
end
@app_path
end
class Exception
#!/bin/bash
# by http://github.com/jehiah
# this prints out some branch status (similar to the '... ahead' info you get from git status)
# example:
# $ git branch-status
# dns_check (ahead 1) | (behind 112) origin/master
# master (ahead 2) | (behind 0) origin/master
tot_diff=0
@tomasv
tomasv / rspec configuration
Created March 6, 2013 00:29
Spring + Rubymine
In shell:
export RUBYLIB=/path/to/RubyMine/rb/testing/patch/common:/path/to/RubyMine/rb/testing/patch/bdd
spring rspec spec/ # to launch spring server
In Rubymine:
Uncheck bundler
Select custom runner script as spring_rspec.rb
add same variable to environment variables:
RUBYLIB=/path/to/RubyMine/rb/testing/patch/common:/path/to/RubyMine/rb/testing/patch/bdd