Skip to content

Instantly share code, notes, and snippets.

View steevhise's full-sized avatar
💭
datawranglin'

Steev Hise steevhise

💭
datawranglin'
View GitHub Profile
@steevhise
steevhise / cmd line audio commands
Created November 10, 2024 14:08
saving how to deal with sound devices on CLI
# get the list of audio devices
pactl list
pactl set-defaut-sink <device name> # set the output device
pactl list sources|sinks # list the outputs or inputs
pactl load-sample <sound file>
pactl list-samples # get list of loaded sound samples
pactl play-sample <sample name>
# pipe from input to output
arecord | aplay
@steevhise
steevhise / freecycletestgist
Created January 11, 2022 16:36
just to see if this shows up under freecycle.
i want this to be under /freecycle not under /steevhise --- *but will it?*
@steevhise
steevhise / fc-filesystem-loader.js
Last active October 26, 2017 21:48
custom swig-templates template loader
/**
* fc-filestystem-loader
* This custom Swig template loader does 2 things differently from the regular Swig filesystem loader:
* 1. missing template files return an error string rather than throwing an error
* 2. if file isn't found in default place, looks in the "IncludeDir" (for common partials)
*
*/
let target;
@steevhise
steevhise / a.md
Last active April 13, 2017 18:22
regex for converting js object to graphql

JSON.stringify(this, groupFields).replace(/"([^"]+)":/g, '$1:');

@steevhise
steevhise / gitloose.md
Last active April 13, 2017 22:57
git commands for "loose ends"

To list branches with commits not merged into master:

git branch --no-merged master

To list the relevant commits:

git cherry -v master <branch>

To see both local and remote: git branch -a --no-merged master

@steevhise
steevhise / gist:19088895181c4e62241eaf4289b146f7
Created November 23, 2016 18:31
Simple node.js code style tips to improve code quality

Whether you use 2 spaces or 4 spaces, there are a few simple things that can make your node.js code easier to read. We've been using them in all the hapi modules for over 4 years now to great results. This list is by no means complete but it highlights the most useful elements that will give you immediate value in reducing bugs.

Required modules

JavaScript makes it harder than most languages to know where variables are coming from. Variables assigned required modules are particularly important because they represent a singleton object shared with the entire application. There are also globals and module globals, along with function variables and arguments.

Traditionally, variables starting with an uppercase letter represent a class that must be instantiated using new. This was an important semantic in the early days of JavaScript but at this point, if you don't know Date requires new Date() you are probably very new. We have adopted Upper Camel Case variable names for all module global variables

@steevhise
steevhise / gitlastcommits
Created January 14, 2015 17:30
list all commits since last tag formatted to put in debian change log
git log `git describe --tags --abbrev=0`..HEAD --pretty=format:"* %s" --no-merges
@steevhise
steevhise / test.txt
Created July 7, 2011 00:11
test gist
hello, world.