Skip to content

Instantly share code, notes, and snippets.

View countable's full-sized avatar

Clark Van Oyen countable

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<title>ds demo</title>
<script src="https://cdn.jsdelivr.net/npm/datascript@1.3.7/datascript.js"></script>
<style>
.namespaces {
margin: 0;
padding: 0;
}
@countable
countable / warnie.html
Created April 18, 2019 21:44
Warn Your Users They Are Using Internet Explorer, Ask Them To Upgrade
<div id="iewarn" style="z-index:2000000;position:fixed;top:0;left:0;right:0;height:55px;padding:15px;box-sizing:border-box;background:red;color:white;font-size:18px">
Warning: You are using internet explorer. Microsoft (the vendor) itself <a href="https://techcommunity.microsoft.com/t5/Windows-IT-Pro-Blog/The-perils-of-using-Internet-Explorer-as-your-default-browser/ba-p/331732">does not recommend</a> using this browser any more and some parts of this website will not work in it. Please <a href="https://www.mozilla.org/en-CA/firefox/new/">update</a>. <a href="#" onclick="document.getElementById('iewarn').style.display='none'">Close</a>.
</div>
<script>
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || true) {
document.getElementById('iewarn').style.display='block';
}
@countable
countable / docker-compose.yml
Created February 4, 2019 07:25
Dockerized Wordpress Site
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- dbdata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
@countable
countable / netflix-disable-paw-patrol
Last active June 10, 2018 05:45
Disable Paw Patrol in Netflix. Want to prevent this vapid content from making your children dumb? Install tampermonkey browser extension for Chrome and create a new user script with this content.
// ==UserScript==
// @name Disable Paw Patrol in Netflix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disable Paw Patrol in Netflix
// @author Clark Van Oyen
// @match https://www.netflix.com/Kids
// @grant none
// ==/UserScript==
@countable
countable / gmail-domain-warning
Last active May 5, 2018 23:26
Tampermonkey script to warn when sending to addresses with 2 different domains in Gmail.
// ==UserScript==
// @name Gmail Domain Warning
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Tampermonkey script to warn when sending to addresses with 2 different domains in Gmail.
// @author You
// @match https://mail.google.com/mail/u/0/
// @grant none
// ==/UserScript==
@countable
countable / rbc-bookmarklet.js
Created January 5, 2018 05:13
Auto-populate date in RBC Payroll (pay employees and vendors)
/* RBC payroll page, auto-select today's date.*/
var dom = (new Date()).getDate();
$('[name="DUE_DATE_DAY"]').val((dom <= 9 ? '0' : '') + dom);
$('[name="DUE_DATE_MONTH"]').val((new Date()).getMonth() + 1);
$('[name="DUE_DATE_YEAR"]').val((new Date()).getFullYear());
Save it as a bookmarklet, ie using this - http://www.moxleystratton.com/blog/2006/01/11/bookmarklet-compiler/
@countable
countable / facebook-messages-only.md
Last active January 2, 2018 22:49
Keep facebook Emails in Check (in gmail)

Disable facebook Notifications other than Private Messages

Facebook is quite tricky and aggressive when sending email notifications. I've not been able to find a way to only receive emails when someone PMs me without also receiving tons of AI generated cruft. This is probably by design, as most people won't completely disable notifications for fear of missing a message from a friend.

If you only want to receive facebook emails when people actually message you, and none of the annoying recommendations, add the following filter in gmail:

from:(*@facebookmail.com) subject:(-"sent you a message")
@countable
countable / restore-db
Last active October 30, 2017 21:27
Restore a database (saved in db.sql) to postgres container. Assumes Countable's naming conventions for containers.
#!/bin/bash
docker_compose_id=$(pwd | grep -oh "[^/]*$" | sed "s/[^a-z\d]//g")
echo $docker_compose_id
docker cp ${1:-db.sql} ${docker_compose_id}_db_1:/tmp/
docker-compose stop web
docker-compose exec db dropdb -U postgres postgres
docker-compose exec db createdb -T template_postgis -U postgres postgres
docker-compose exec db psql -U postgres -f /tmp/${1:-db.sql} postgres
docker-compose up -d web
@countable
countable / class-test.coffee
Created April 10, 2015 07:40
Javascript Inheritance Test (coffeescript actually)
_extends = (child, parent)->
for own key,val of parent
child[key] = parent[key]
ctor = ->
this.constructor = child;
ctor.prototype = parent.prototype
child.prototype = new ctor()
child.__super__ = parent.prototype
@countable
countable / perm.bash
Created June 27, 2014 18:52
Canonical Developer Permissions
#!/bin/bash
# Set permissions to be editable by all developers. Assumes all developers belong to a group, "dev". Works recursively on the current directory. DO NOT run in the unix root directory, only inside a code project. TODO: add a check that we're not in the root.
alias perm='sudo chmod -R g+rw . && sudo chgrp -R dev . && find . -type d | sudo xargs chmod g+s'