(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
Important: your node location may vary. Use which node
to find it, or use it directly in the command:
You probably don't want Google crawling your development staging app. Here's how to fix that.
$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt
Now edit config/routes.rb
to add a route for /robots.txt
, and add the controller code.
function trackJavaScriptError(e) { | |
var ie = window.event || {}; | |
var message = e.message || ie.errorMessage || '<no message>' | |
var filename = e.filename || ie.errorUrl || '<no filename>'; | |
var lineno = e.lineno || ie.errorLine || '<no lineno>'; | |
var colno = e.colno || ie.errorColumn || '<no colno>'; | |
var source = filename + ':' + lineno + ':' + colno; | |
ga('send', 'event', 'JavaScript Exception', message, source, {'nonInteraction': 1}); | |
} |
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
on alfred_script(q) | |
tell application "Adium" to go away | |
tell application "Skype" | |
send command "SET USERSTATUS AWAY" script name "Alfred" | |
end tell | |
end alfred_script |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.
apiVersion: extensions/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: restricted | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' | |
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' | |
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' | |
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' | |
spec: |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
-- https://github.com/wg/wrk | |
-- wrk -c 1000 -d 10s -s random-path-url.lua http://localhost:8080 | |
local paths = { | |
"/path1.txt", | |
"/path2.txt", | |
"/path3.txt", | |
"/path4.txt", | |
"/path5.txt", | |
"/path6.txt" |