Skip to content

Instantly share code, notes, and snippets.

View edwingustafson's full-sized avatar
💭
Upon Ye Olde Internetworke

Edwin Gustafson edwingustafson

💭
Upon Ye Olde Internetworke
  • Charlevoix, Michigan, USA
View GitHub Profile
@shiffman
shiffman / sketch.js
Created May 18, 2023 15:53
Gist from VSCode Stream
let stars = [];
let factor = 100;
let speedSlider;
function setup() {
createCanvas(windowWidth, windowHeight);
speedSlider = createSlider(0, 20, 2, 0.1);
for (let i = 0; i < 500; i++) {
stars[i] = createVector(
random(-width*factor,width*factor),
@vividvilla
vividvilla / osxtweaks
Created January 8, 2020 10:45 — forked from webdevbrian/osxtweaks
Brian's List of OSX Tweaks for web developers
#OSX Tweaks:
===========
- Most need reboot to show changes
- Most of these tweaks are just for speed, but some are specific for development
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign.
- I'm not responsible for any adverse effects to your computer, at all.
##Increase the speed of OS X dialogs boxes:
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 12, 2025 13:07
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@two7sclash-zz
two7sclash-zz / latency_humanized.markdown
Created October 13, 2016 14:28
Latency numbers every programmer should know

Lets multiply all these durations by a billion:

Magnitudes:

Minute:

L1 cache reference                  0.5 s         One heart beat (0.5 s)
Branch mispredict                   5 s           Yawn
L2 cache reference                  7 s           Long yawn
Mutex lock/unlock                   25 s          Making a coffee
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@pgwillia
pgwillia / LogDIH.js
Last active June 20, 2019 15:09
how to log in Solr DIH ScriptTransformer
function transformer(row){
var log = java.util.logging.Logger.getLogger("transformer");
var LEVEL = java.util.logging.Level.INFO;
log.log(LEVEL, "hello world")
}
@sym3tri
sym3tri / monad.js
Last active February 24, 2020 02:31
Simple Monad example in JavaScript
// as discussed by Crockford here: http://www.youtube.com/watch?v=dkZFtimgAcM
// more detailed example here: https://github.com/douglascrockford/monad/blob/master/monad.js
function MONAD() {
return function unit(value) {
var monad = Object.create(null);
monad.bind = function (func) {
return func(value);
};
return monad;
@bradsokol
bradsokol / bash_prompt.sh
Last active January 6, 2024 07:36 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, Git, Mercurial or Subversion branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current Git, Mercurial or Subversion repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';