Collection of useful tips & tricks to set up on a Mac.
Safari: bind cmd+alt+arrows to switch between previous/next tab
defaults write -app Safari NSUserKeyEquivalents '{
"Show Next Tab" = "@~\\U2192";
"Show Previous Tab" = "@~\\U2190";
}'
# LS_COLORS | |
# Maintainers: Magnus Woldrich <m@japh.se>, | |
# Ryan Delaney <ryan.patrick.delaney@protonmail.com> | |
# URL: https://github.com/trapd00r/LS_COLORS | |
# | |
# This is a collection of extension:color mappings, suitable to use as your | |
# LS_COLORS environment variable. Most of them use the extended color map, | |
# described in the ECMA-48 document; in other words, you'll need a terminal | |
# with capabilities of displaying 256 colors. | |
# |
// Generate a deterministic pseudo UUID (v4), such that the same input always gives the same output. | |
// Potentially useful for test mocks or such where a specific datum is associated to a specific UUIDs, | |
// but doesn't need guarantees against clashing. | |
// With ES6 modules, you can remove the "require" part, and instead import like this: | |
// import { createHash } from "crypto"; | |
const pseudoUuid = (input) => require("crypto") | |
.createHash("sha256") | |
.update(input) |
#!/bin/bash | |
# Publish JSON payloads into a RabbitMQ HTTP API with curl and jq. | |
# Usage: rabbit_publish.sh exchange_name '{ "data": "my json payload" }' | |
# | |
# To install prequisites on macOS: | |
# brew install rabbitmq jq | |
# rabbitmq-plugins enable rabbitmq_management | |
if [ $# -ne 2 ]; then |
Collection of useful tips & tricks to set up on a Mac.
defaults write -app Safari NSUserKeyEquivalents '{
"Show Next Tab" = "@~\\U2192";
"Show Previous Tab" = "@~\\U2190";
}'
// npm install --save axios cheerio | |
const axios = require('axios'); | |
const cheerio = require('cheerio'); | |
const fetchEvents = () => { | |
return axios.get('https://www.luuppi.fi') | |
.then((response) => { | |
const $ = cheerio.load(response.data); | |
return $(".tapahtuma_otsikko a") |
const TelegramBot = require('node-telegram-bot-api'); | |
const token = 'token-goes-here'; | |
const bot = new TelegramBot(token, { polling: true }); | |
bot.onText(/\/hai/, (message) => { | |
bot.sendMessage(message.chat.id, 'hello looby'); | |
}); | |
console.log('I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.'); |
Some of my terminal preferences to make it look roughly like here: https://twitter.com/mieky/status/817453249632632833
Some other things I can heartily recommend:
Alex Kotliarskyi wrote a great little script to show OS X desktop notifications when a long-running terminal command finishes (and is not in focus).
Making it work with a Vagrant virtual machine turned out to be straightforward. These instructions assume zsh as shell, bash might work similarly.
~/bin/notifyme
(assuming ~/bin is in $PATH, remember to chmod u+x notifyme
)sudo apt-get install ruby
vagrant plugin install vagrant-notify
vagrant halt
& vagrant up
ln -s ~/bin/notifyme ~/bin/notify-send
~/.zshrc
in your Vagrant box:DO WHAT THE FUCK YOU WANT TO + BUY YOURSELF A BEER PUBLIC LICENSE | |
Version 1, Jan 2015 | |
Copyright (C) 2015 Mike Arvela (@mieky) | |
DO WHAT THE FUCK YOU WANT TO + BUY YOURSELF A BEER PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
0. You just DO WHAT THE FUCK YOU WANT TO. |
DO WHAT THE FUCK YOU WANT TO + GLUTEN-FREE BEER/PIZZA PUBLIC LICENSE | |
Version 1, Feb 2013 | |
Copyright (C) 2013 Mike Arvela | |
DO WHAT THE FUCK YOU WANT TO + GLUTEN-FREE BEER/PIZZA PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
0. You just DO WHAT THE FUCK YOU WANT TO. |