This project has moved to https://github.com/jonhoo/drwmutex so it can be imported into Go applications.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EventEmitter from 'events'; | |
import Dispatcher from '../dispatcher'; | |
const CHANGE_EVENT = 'change'; | |
export default class BaseStore extends EventEmitter { | |
constructor() { | |
super(); | |
this.dispatchToken = Dispatcher.register(this.handleDispatch.bind(this)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Publishes CloudWatch metrics about Buildbox queue length | |
set -e | |
API='https://api.buildbox.io' | |
BUILDS_ROUTE='v1/accounts/ACCOUNT_NAME/projects/PROJECT_NAME/builds' | |
# Determines whether a binary exists on the current $PATH |
This text explains how to create and deploy a Docker-based AWS Elastic Beanstalk site and how to control it using CloudFormation.
Please find the CloudFormation template at the end of this Gist.
We assume that you are familiar with AWS ElasticBeanstalk, AWS CloudFormation and Docker.
These rules are adopted from the AngularJS commit conventions.
The prep-script.sh
will setup the latest Node and install the latest perf version on your Linux box.
When you want to generate the flame graph, run the following (folder locations taken from install script):
sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
exports.register = function (plugin, options, next) { | |
function addRoutes(server) { | |
var serverPluginSettings = server.settings.plugins || {}, | |
serverSpecificSettings = serverPluginSettings.routify || {}, | |
routes = serverSpecificSettings.routes || options.routes; | |
if (routes) { | |
server.route(routes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"author":"Barry Smith","text":"Test"},{"author":"James Brown","text":"ASDFG!"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dtrace -n 'syscall::writev:entry /execname == "node" && arg2 > 16/ { printf("iovcnt: %d", arg2); }' -n 'syscall::writev:return /execname == "node" && arg1 == -1 && errno == 22/ { printf("%s %s %d\\n", curpsinfo->pr_psargs, probefunc, errno); jstack(100, 8000); }' | |
1 10260 writev:entry iovcnt: 57 | |
1 10261 writev:return node --nouse-idle-notification /voxer/server/node_router/node_router.js /voxer/ writev 22\n | |
libc.so.1`__writev+0x15 | |
node`uv__write.part.5+0x18f | |
node`uv_write2+0x1b9 | |
node`uv_write+0x35 | |
node`_ZN4node10StreamWrap6WritevERKN2v89ArgumentsE+0x678 | |
node`_ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x157 | |
<< internal code >> |