(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.
I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).
These are my opinions. Read this document through and pick up the good parts to your preferences.
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
id=$(docker ps | grep myimage:latest | awk '{ print $1 }') | |
docker pull quay.io/nnarhinen/myimage | |
new_id=$(docker run -d -p 3000 \ | |
-e ENVIRONMENT=PRODUCTION quay.io/nnarhinen/myimage) | |
id=$new_id ./update-nginx-port.bash | |
docker stop $id |
⇐ back to the gist-blog at jrw.fi
First there was JSLint, and there was much rejoicing. The odd little language called JavaScript finally had some static code analysis tooling to go with its many quirks and surprising edge cases. But people gradually became annoyed with having to lint their code according to the rules dictated by Douglas Crockford, instead of their own.
So JSLint got forked into JSHint, and there was much rejoicing. You could set it up to only complain about the things you didn't want to allow in your project, and shut up about the rest. JSHint has been the de-facto standard JavaScript linter for a long while, and continues to do so. Yet there will always be things your linter could check for you, but doesn't: your team has agreed on some convention that makes sense for them, but JSHint doesn't have an option
<html> | |
<head> | |
<title>Post form in a new window without losing handle to the window</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script> | |
$(function() { | |
$('form').on('submit', function(ev) { | |
var form = $(this); | |
form.attr('target', 'new-window'); |
function getter(attr, scale) { | |
return function(d) { | |
return scale ? scale(d[attr]) : d[attr] | |
} | |
} | |
var defaults = { | |
width: 560, | |
height: 250, | |
x: 'x', |
⇐ back to the gist-blog at jrw.fi
The current Compass bleeding-edge (0.13.alpha.4
) contains awesome new flexbox mixins that allow you to generate styling for all three (!) past and current specifications. See http://css-tricks.com/using-flexbox/ for the details behind the careful interweaving of different properties and prefixes, but the beef is support for:
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
# Install dateutil with "pip dateutil install" | |
from datetime import date, timedelta as td | |
from itertools import count, takewhile | |
def holiday(d): # See https://gist.github.com/pyrtsa/3525697 | |
"""Check whether the given dateutil.date is a Finnish national holiday""" | |
import dateutil.easter | |
from datetime import date, timedelta as td | |
assert isinstance(d, date) |