Skip to content

Instantly share code, notes, and snippets.

View mieky's full-sized avatar
🦀

Mike Arvela mieky

🦀
View GitHub Profile
@mieky
mieky / WTFGFBPPL.txt
Created January 24, 2015 08:47
DO WHAT THE FUCK YOU WANT TO + GLUTEN-FREE BEER/PIZZA PUBLIC LICENSE
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.
@mieky
mieky / WTFBYABPL.txt
Last active August 29, 2015 14:14
DO WHAT THE FUCK YOU WANT TO + BUY YOURSELF A BEER PUBLIC LICENSE
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.
@mieky
mieky / HOWTO.md
Last active July 26, 2016 07:15
notify-on-completion for Vagrant

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.

  1. Following Alex's instructions, install the notifyme script on OS X, in e.g. ~/bin/notifyme (assuming ~/bin is in $PATH, remember to chmod u+x notifyme)
  2. (Vagrant) Install Ruby on the VM: sudo apt-get install ruby
  3. (OS X) Install the vagrant-notify plugin: vagrant plugin install vagrant-notify
  4. (OS X) Restart the virtual machine: vagrant halt & vagrant up
  5. (OS X) Alias our script under a name which the plugin knows: ln -s ~/bin/notifyme ~/bin/notify-send
  6. (Vagrant) Append to the end of the ~/.zshrc in your Vagrant box:
@mieky
mieky / README.md
Created January 8, 2017 08:41
Mike's terminal
@mieky
mieky / looby-bot-1.js
Created February 16, 2017 10:36 — forked from anttti/looby-bot-1.js
looby-bot-1
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.');
// 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")
@mieky
mieky / macos-lifehacks.md
Last active December 2, 2023 21:10
MacOS Lifehacks

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";
}'
@mieky
mieky / rabbit_publish.sh
Last active March 28, 2024 05:27
Publish a JSON payload into a local RabbitMQ HTTP API
#!/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
// 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)
@mieky
mieky / .dir_colors
Last active February 27, 2021 13:21
macOS LS_COLORS for web development
# LS_COLORS
# Maintainers: Magnus Woldrich <[email protected]>,
# Ryan Delaney <[email protected]>
# 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.
#