Skip to content

Instantly share code, notes, and snippets.

View briandemant's full-sized avatar
💭
is happy coding

Brian Demant briandemant

💭
is happy coding
View GitHub Profile
@briandemant
briandemant / slack-dark-mode.sh
Created February 8, 2019 06:45 — forked from mmrko/slack-dark-mode.sh
Dark Mode for Slack (macOS)
#!/usr/bin/env bash
# Homebaked Slack Dark Mode. After executing this script, hit refresh (⌘ + R) or restart Slack for changes to take effect.
# Adopted from https://gist.github.com/a7madgamal/c2ce04dde8520f426005e5ed28da8608
SLACK_RESOURCES_DIR="/Applications/Slack.app/Contents/Resources"
SLACK_SSB_INTEROP_FILEPATH="$SLACK_RESOURCES_DIR/app.asar.unpacked/src/static/ssb-interop.js"
THEME_FILEPATH="$SLACK_RESOURCES_DIR/dark-theme.css"
curl -o "$THEME_FILEPATH" "https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css"

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@briandemant
briandemant / fake_sendmail.sh
Last active September 5, 2016 07:59 — forked from xianhuazhou/gist:1415626
a fake sendmail script for testing mail related applications, can replace /usr/sbin/sendmail
#!/bin/sh
# Source : https://github.com/Sanchiz/fake_sendmail.sh
prefix="/home/USERNAME/sendmail/new"
numPath="/home/USERNAME/sendmail"
if [ ! -f $numPath/email_numbers ]; then
echo "0" > $numPath/email_numbers
fi
var dom = Bloop.dom;
var Box = Bloop.createClass({
getInitialState: function() {
return { number: 0 };
},
updateNumber: function() {
this.state.number++;
},
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
$ cat test.js
function foo () { while (true) { } }
function bar () { return foo(); }
bar();
$ node test.js &
$ gdb attach $(pidof node)
0x00000bf778c63d5f in ?? ()
(gdb) b v8::internal::Runtime_StackGuard
Breakpoint 1 at 0x84a1f0
(gdb) print 'v8::V8::TerminateExecution'(0)
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Cross-Fading Images With AngularJS
</title>
<style type="text/css">
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Lazy Loading Images With AngularJS
</title>
<style type="text/css">
@briandemant
briandemant / README.md
Last active December 20, 2015 09:49 — forked from tmcw/README.md
@briandemant
briandemant / child_monitor.coffee
Created November 4, 2012 13:56 — forked from turtlesoupy/child_monitor.coffee
A node.js process supervisor and a sample use with health checks - see http://blog.argteam.com/coding/hardening-nodejs-production-process-supervisor/
{_} = require 'underscore'
child_process = require 'child_process'
async = require 'async'
healthCheckInterval = 60 * 1000
bounceInterval = 60 * 1000
bounceWait = bounceInterval + 30 * 1000
delayTimeout = (ms, func) -> setTimeout func, ms
class MonitoredChild