Skip to content

Instantly share code, notes, and snippets.

☺️

Mike Arvela mieky

☺️
Block or report user

Report or block mieky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mieky
mieky / macos-lifehacks.md
Last active Nov 28, 2019
MacOS Lifehacks
View macos-lifehacks.md

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";
}'
View fetch-luuppi-events.js
// 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")
View looby-bot-1.js
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.');
@mieky
mieky / README.md
Created Jan 8, 2017
Mike's terminal
View README.md
@mieky
mieky / HOWTO.md
Last active Jul 26, 2016
notify-on-completion for Vagrant
View HOWTO.md

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 / WTFBYABPL.txt
Last active Aug 29, 2015
DO WHAT THE FUCK YOU WANT TO + BUY YOURSELF A BEER PUBLIC LICENSE
View WTFBYABPL.txt
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 / WTFGFBPPL.txt
Created Jan 24, 2015
DO WHAT THE FUCK YOU WANT TO + GLUTEN-FREE BEER/PIZZA PUBLIC LICENSE
View WTFGFBPPL.txt
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 / config.cson
Last active Aug 29, 2015 — forked from viljamis/config.cson
My Atom editor settings. Context & screenshot: https://twitter.com/mieky/status/504594698586308608
View config.cson
'editor':
'lineHeight': 1.45
'softWrap': true
'normalizeIndentOnPaste': true
'tabLength': 2
'preferredLineLength': 100
'invisibles':
'cr': ''
'eol': ''
'space': '·'
@mieky
mieky / keybase.md
Last active Aug 29, 2015
My Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am mieky on github.
  • I am mieky (https://keybase.io/mieky) on keybase.
  • I have a public key whose fingerprint is 350A B06C 792A 82F1 366D E963 93D7 B993 577E ED8B

To claim this, I am signing this object:

@mieky
mieky / group_jquery_events.js
Last active Aug 29, 2015
Calculate events bound via jQuery
View group_jquery_events.js
function getEvents(sel) {
return $(sel).toArray().reduce(function(acc, el) {
var events = $._data(el, 'events');
if (events) acc.push(events);
return acc;
}, []);
}
function calculateEvents(acc, obj) {
for (key in obj) {
You can’t perform that action at this time.