Skip to content

Instantly share code, notes, and snippets.

View cwharris's full-sized avatar
🖖

Christopher Harris cwharris

🖖
View GitHub Profile
@cwharris
cwharris / install-1password.sh
Last active July 21, 2023 14:22
Install 1Password
#!/bin/bash
# wget -O - <this gist> | bash
set -Eeox pipefail
# install 1password
sudo apt-get -y install curl
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list
@gweinhold
gweinhold / azure.cs
Created September 10, 2015 20:29
Workaround for Azure Webjobs in development machine.
public static void Main(string[] args)
{
#if DEBUG
GetJobsFromQueue();
#else
var host = new JobHost();
host.RunAndBlock();
#endif
}
@jefflarkin
jefflarkin / cudaCheckError.c
Created April 15, 2013 20:18
A simple macro for checking errors after CUDA library calls.
//Macro for checking cuda errors following a cuda launch or api call
#define cudaCheckError() { \
cudaError_t e=cudaGetLastError(); \
if(e!=cudaSuccess) { \
printf("Cuda failure %s:%d: '%s'\n",__FILE__,__LINE__,cudaGetErrorString(e)); \
exit(0); \
} \
}
@henrik
henrik / rules.md
Last active May 23, 2022 12:31
Sandi Metz' four rules from Ruby Rogues episode 87. Listen or read the transcript: http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/
  1. Your class can be no longer than 100 lines of code.
  2. Your methods can be no longer than five lines of code.
  3. You can pass no more than four parameters and you can’t just make it one big hash.
  4. When a call comes into your Rails controller, you can only instantiate one object to do whatever it is that needs to be done. And your view can only know about one instance variable.

You can break these rules if you can talk your pair into agreeing with you.