// jQuery
$(document).ready(function() {
// code
})
var data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); }); |
#!/bin/bash | |
set -e | |
SECRETFILE=~/.digitalocean | |
if [[ -z $DIGOCEAN_ID ]] || [[ -z $DIGOCEAN_KEY ]]; then | |
if [ -e $SECRETFILE ]; then | |
. $SECRETFILE | |
fi | |
fi |
This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.
In that post I talked about 3 main reasons for moving from require.js to webpack:
- Common JS support
- NPM support
- a healthy loader/plugin ecosystem.
Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
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:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
As configured in my dotfiles.
start new:
tmux
start new with session name:
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |