Skip to content

Instantly share code, notes, and snippets.

View mieky's full-sized avatar
🦀

Mike Arvela mieky

🦀
View GitHub Profile
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@kimmobrunfeldt
kimmobrunfeldt / 0-osx-for-web-development.md
Last active July 26, 2022 13:30
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

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.

System preferences

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 10, 2025 09:21
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

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"

Results

@nnarhinen
nnarhinen / deploy.bash
Last active December 31, 2015 12:28
My deployment script to pull and run a docker-contained clojure web application
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
@jareware
jareware / gist.md
Last active January 30, 2024 03:15
Project-specific lint rules with ESLint

⇐ back to the gist-blog at jrw.fi

Project-specific lint rules with ESLint

A quick introduction

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

@nnarhinen
nnarhinen / index.html
Created August 9, 2013 07:42
POST Form to new window and wait for postMessage
<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');
@chesles
chesles / d3.linechart.js
Created May 31, 2013 18:40
Reusable line chart using d3.chart
function getter(attr, scale) {
return function(d) {
return scale ? scale(d[attr]) : d[attr]
}
}
var defaults = {
width: 560,
height: 250,
x: 'x',
@jareware
jareware / gist.md
Last active June 7, 2018 04:16
Backporting Compass flexbox mixins from bleeding-edge (0.13.alpha.4) to current stable (0.12.2)

⇐ back to the gist-blog at jrw.fi

New Compass flexbox mixins

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:

  • Chrome any
  • Firefox any
  • Safari any
  • Opera 12.1+
@cobyism
cobyism / gh-pages-deploy.md
Last active April 12, 2025 09:10
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

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.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@pyrtsa
pyrtsa / year_workdays.py
Last active October 13, 2015 09:28
Workdays in 2013
# 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)