Skip to content

Instantly share code, notes, and snippets.

View PMK's full-sized avatar

PMK PMK

View GitHub Profile
@PMK
PMK / bookmarklet.js
Last active September 8, 2015 15:05
Plug.dj "auto woot" bookmarklet. Install instructions: http://alturl.com/gfhzv. When you change rooms, you need to re-enable it.
javascript:(function(){window.API.on(window.API.HISTORY_UPDATE,function(){setTimeout(function(){window.jQuery("#woot").click();},1000);});window.onbeforeunload=function(){window.API.off(window.API.HISTORY_UPDATE);};}());
@PMK
PMK / convertMp4ToMp3.sh
Last active May 19, 2018 14:07
Convert mp4 to mp3 with faad and lame
#!/bin/bash
function convertMp4ToMp3 { faad -q -w -f 2 "$1" | lame --quiet -r -h -b 320 - "${1%.mp4}.mp3"; }
@PMK
PMK / backup_firefox.sh
Created April 4, 2016 08:48
Mozilla Firefox profile (w/ bookmarks, history and addons) backup Bash script for Mac OS X
#!/bin/bash
#####
# Created by PMK
# https://github.com/PMK
#
# License: Public Domain
#
# Creates a tar archive of the current active profile of Mozilla Firefox.
# The profile contains sessions, addons, bookmarks and history.
@PMK
PMK / blacklist
Created August 20, 2018 10:00
Blacklist Cliqz for Firefox
# blacklist
#
# The contents of this file (containing a listing of additional domains in
# 'hosts' file format) are appended to the unified hosts file during the
# update process. For example, uncomment the following line to block
# 'example.com':
# 0.0.0.0 example.com
@PMK
PMK / setup-firehol.sh
Last active October 14, 2018 13:32
Setup Firehol firewall
sudo apt-get -qq -y install iptables ipset iprange fail2ban firehol &>/dev/null
sudo tee -a /etc/fail2ban/jail.local >/dev/null <<__EOF
[DEFAULT]
banaction = iptables-ipset-proto6-allports
__EOF
sudo tee -a /etc/firehol/firehol-defaults.conf >/dev/null <<__EOF
IPTABLES_CMD="/sbin/iptables -w"
__EOF
@PMK
PMK / _negative-border-radius.scss
Created November 1, 2018 15:59
Handy SCSS utils
// Creates a "negative border-radius"
//
// Author: PMK
// License: MIT
@mixin negative-border-radius($color: #000, $contrast: transparent, $position: all, $size: 1rem) {
background-repeat: no-repeat;
@if $position == all {
background:
radial-gradient(circle at 0 100%, $contrast $size, $color $size),
@PMK
PMK / TestComponent.test.js
Created May 23, 2018 07:13
Mocha-webpack with Vue
import { mount } from '@vue/test-utils'
import { assert } from 'chai'
import Component from '../../../../src/components/TestComponent.vue'
describe('TestComponent.vue', () => {
it('renders', () => {
const wrapper = mount(Component)
assert.isTrue(
wrapper.is(true)