Skip to content

Instantly share code, notes, and snippets.

View _negative-border-radius.scss
// 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 / setup-firehol.sh
Last active Oct 14, 2018
Setup Firehol firewall
View setup-firehol.sh
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 / blacklist
Created Aug 20, 2018
Blacklist Cliqz for Firefox
View blacklist
# 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 / TestComponent.test.js
Created May 23, 2018
Mocha-webpack with Vue
View TestComponent.test.js
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)
@PMK
PMK / convertMp4ToMp3.sh
Last active May 19, 2018
Convert mp4 to mp3 with faad and lame
View convertMp4ToMp3.sh
#!/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 Apr 4, 2016
Mozilla Firefox profile (w/ bookmarks, history and addons) backup Bash script for Mac OS X
View backup_firefox.sh
#!/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 / bookmarklet.js
Last active Sep 8, 2015
Plug.dj "auto woot" bookmarklet. Install instructions: http://alturl.com/gfhzv. When you change rooms, you need to re-enable it.
View bookmarklet.js
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);};}());