Skip to content

Instantly share code, notes, and snippets.

View djbender's full-sized avatar
🕵️‍♂️

Derek Bender djbender

🕵️‍♂️
View GitHub Profile
@jesstelford
jesstelford / event-loop.md
Last active December 5, 2024 02:05
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

#!/bin/sh
set -e
trap "rm -f tags.$$" EXIT
ctags --tag-relative -Rftags.$$ \
--exclude=.git \
--exclude=public/javascripts/vendor \
--exclude=public/flash \
--exclude=node_modules \
--exclude=public/javascripts/compiled \
--exclude=public/javascripts/bower \
@jewelia
jewelia / gist:0b8f26e91f2818bef460
Last active August 29, 2015 14:15
3 Great Engineering Management Talks from 2014

General key themes:

  • Hiring is really hard. You’re not just hiring a “Rails Engineer” or a “Python Programmer” you’re hiring someone who can help you change the world. Tell them why! Talk about the hard problems you’re solving. 2/3 of these talks give ideas and insight into hiring from sourcing to actual interview processes.

  • Rewriting systems is hard. People think they are going to replace their broken down horse and buggie with a bullet train and this often ends up in disaster. Successful rewrites require an incremental approach that takes months/years and often runs way over schedule. 2/3 of these talks go over how to handle rewrites not only from a high level technical perspective but a cultural/management perspective as well.

Two Developers, Many Lines of Code, and A Campaign that Made History

Harper Reed (CTO of Obama for America, now CEO of Modest) and Dylan Richard (Director of Eng of Obama for America, now CTO of Modest)

@telmofcosta
telmofcosta / backup-restore sdcard
Created February 8, 2015 12:16
Backup and restore an SD card on Mac OS x (perfect for Raspberry Pi)
# insert SD and find out where it is mounted
diskutil list
# /dev/disk0
# #: TYPE NAME SIZE IDENTIFIER
# 0: GUID_partition_scheme *250.1 GB disk0
# ...
# /dev/disk1
# #: TYPE NAME SIZE IDENTIFIER
# 0: FDisk_partition_scheme *15.7 GB disk1
# ...
export APPLICATION_NAME="endorsemint"
export APPLICATION_SESSION_SECRET="endorsemint"
export APPLICATION_LOG_LEVEL="DEBUG"
export DATABASE_POOL=5
export DATABASE_REAP_FREQUENCY=5
export DATABASE_TIMEZONE="utc"
export DATABASE_TIMEOUT=15
export DATABASE_URL="postgres://endorsemint@localhost:5432/endorsemint_development"
export PORT=9292
export PUMA_THREADS_MAX=1
@mbj
mbj / segfault.rb
Last active August 29, 2015 14:07
segfault.rb - Intentionally crash ruby
require 'ffi'
module Segfault
extend FFI::Library
ffi_lib 'ruby'
attach_function :rb_bug, [:string, :varargs], :void
end # Segfault
Segfault.rb_bug('%s', :string, 'test bug')
class @Reloader
constructor: (@selector = '.wrapper', @path, @interval = 2000) ->
@start()
start: =>
@timer = setInterval(@fetch, @interval)
stop: =>
clearInterval(@timer)
require 'virtus'
class User
include Virtus.model
attribute :confirmed_at, Time
attribute :subscribed, Boolean, default: false
end
class Screencast
@steveklabnik
steveklabnik / Entfremdung.md
Created August 3, 2014 18:15
alienation 101

Quick summary:

Alienation is one of the ways that capitalism sucks. It's a symptom that something's not right, not the underlying cause. Alienation is something that happens because of the way that capitalism is built.

In short, alienation is a separation between things that should be together. This separation causes tension.

Four ways that capitalism is alienating:

From your product of labor