Skip to content

Instantly share code, notes, and snippets.

🧘‍♂️
practicing mindfulness

David Ernst dsernst

🧘‍♂️
practicing mindfulness
View GitHub Profile
@dsernst
dsernst / gmail-datetime-to-isodate.js
Created Jan 26, 2016
Convert a Gmail datetime into an ISODate for Mongo
View gmail-datetime-to-isodate.js
// Convert a Gmail datetime into an ISODate for Mongo
function gmailToIso(string) {
return 'ISODate("' + new Date(string.split('at ').join('')).toISOString() + '")'
}
View places-i-visited-with-florian-and-noah.md

https://www.youtube.com/watch?v=U3_VUWWh7iw

  • white indents are the ones I wasn't with him for
    • Miami
  • Dallas
  • Somewhere near Portland (Oregon)
    • Campbell Falls (Massachusetts)
  • Chicago
  • Glacier National Park (Montana)
  • Thermopiles (Wyoming)
@dsernst
dsernst / fun-things-around-sf.md
Created Dec 29, 2015
Fun things in San Francisco
View fun-things-around-sf.md

Fun things in San Francisco

A friend was visiting town so we were coming up with some of the best things to show him in San Francisco. These are some of my favorites:

  • Palace of Fine Arts
  • Walking around civic center / downtown / Financial District
  • Cable cars
  • Ocean Beach
  • Sutro Baths & Lands End
  • exploring Golden Gate Park
@dsernst
dsernst / talk-ideas.md
Created Dec 29, 2015
Longer Hack Reactor Lecture ideas
View talk-ideas.md

Longer Hack Reactor Lecture ideas:

  • Famous problems in computer science
  • how to send encrypted messages
  • passwords are obsolete
  • important events in the history of open-source
  • the earliest computers
  • why do people care about bitcoin?
  • Gödel's Incompleteness Theorem
  • most common biases that confuse our thinking
@dsernst
dsernst / atom-stylesheet.less
Created Oct 8, 2015
My custom style modifications to Atom
View atom-stylesheet.less
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@dsernst
dsernst / stache-calc.js
Last active Oct 8, 2015
Code to calculate weekly 'stache growth
View stache-calc.js
/* eslint-env node */
module['exports'] = function echoHttp (hook) {
console.log('hook.req', hook.req.method)
// console.log('hook.params', hook.params['attachment-1']['body-plain'])
console.log('hook.params', hook.params)
if (hook.req.method === 'POST') {
console.log('in POST request')
}
@dsernst
dsernst / osx_dockerhost.sh
Created Oct 8, 2015
Use `dockerhost` instead of the IP of your docker-machine vm
View osx_dockerhost.sh
echo $(docker-machine ip default) dockerhost | sudo tee -a /etc/hosts
@dsernst
dsernst / say-before.git.sh
Created Sep 5, 2015
Example of modifying git to do something else before it runs
View say-before.git.sh
# Add this to the top of your .bash_profile
git () {
say "git";
/usr/local/bin/git "$@";
}
@dsernst
dsernst / measure-logging-speeds.md
Last active Sep 5, 2015
Speed testing node's default console.log, versus an async logger, versus no logging.
View measure-logging-speeds.md

Tested with the looping going up to n <= 65

node-simplelogger: 12.2s (with slight delay after it finished printing before the process ended)
no logging: 10.6s
console.log: 12.8s

These measurements came from adjust line 33 of this file: https://github.com/dsernst/ProjectEuler/blob/67a9c17f0810ff6a5da5c20c027e8c11c7a0c304/53%20Combinatoric%20selections.js#L33

The point of these tests were to see if using an asyncronous logger would be faster than node's built in console. In this case, it did not make a meaningful difference.

@dsernst
dsernst / .eslintrc
Last active Sep 5, 2015
~/.eslintrc
View .eslintrc
{
"rules": {
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"comma-dangle": [1, "always-multiline"],
"indent": [1, 2],
"new-cap": 1,
"no-alert": 1,
"no-console": 1,
"no-debugger": 1,
"no-dupe-args": 2,
You can’t perform that action at this time.