Skip to content

Instantly share code, notes, and snippets.

View bathos's full-sized avatar
⚱️
gimme elixir!

Darien Maillet Valentine bathos

⚱️
gimme elixir!
View GitHub Profile
@bathos
bathos / decor8.js
Last active September 21, 2022 18:03
decorators
// CLASS DECORATORS ////////////////////////////////////////////////////////////
/*
These can be thrown on to augment the class with the static properties method
and $arguments, which makes it possible to generically attach them to an
angular module without the angular module "directory" file needing to know any
particulars about the individual providers:
import hnAuth from './services/hn-auth';
@bathos
bathos / ng-material-color-classes.js
Last active March 17, 2016 05:32
md color classes (.text & .background w/ contrast text)
module.run(($mdColorPalette, $mdTheming) => {
const { THEMES } = $mdTheming;
const rules = [];
for (const themeName in THEMES) {
const { colors } = THEMES[themeName];
const themeCls = themeName == 'default' ? '' : `.md-${ themeName }-theme`;
@bathos
bathos / sailormoon-helper.js
Last active June 27, 2016 02:44
sketchy thing I had in an about:blank tab so I could keep track of where I am in sailor moon -- paste in console
// STATE ///////////////////////////////////////////////////////////////////////
const state = {
down: false,
index: 0
};
// DATA ////////////////////////////////////////////////////////////////////////
const scouts = [
@bathos
bathos / angular-ui-router.js
Created December 25, 2016 15:43
1.0.0-beta.3 built bundle
/*!
* State-based routing for AngularJS
* @version v1.0.0-beta.3
* @link https://ui-router.github.io
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("angular"));
else if(typeof define === 'function' && define.amd)
@bathos
bathos / extreme-chrome-reset.css
Created December 27, 2016 02:19
extreme chrome css reset
/* Slash and burn / shock and awe / total war CSS reset for Chrome specifically */
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1,
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1,
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1,
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1,
:-webkit-any(article,aside,nav,section) h1,
::-webkit-input-placeholder,
:focus,
a:-webkit-any-link,
@bathos
bathos / hid.js
Created February 23, 2017 15:40
replacement entry for node-hid?
const assert = require('assert');
const binary = require('node-pre-gyp');
const { Duplex } = require('stream');
const SHARED_METHOD_KEYS = [
'getDeviceInfo',
'getFeatureReport',
'sendFeatureReport',
'setNonBlocking'
];
@bathos
bathos / hid.js
Created March 1, 2017 15:37
hid.js
const binary = require('node-pre-gyp');
const binding = require(binary.find(require.resolve('node-hid/package.json')));
const { Duplex } = require('stream');
const SHARED_METHOD_KEYS = [
'getDeviceInfo',
'getFeatureReport',
'sendFeatureReport',
'setNonBlocking'
@bathos
bathos / .eslintrc.yaml
Last active May 18, 2017 22:15
personal eslint config 2017 update
%YAML 1.2
---
# This is the client config, but it is also used as the basis of the server
# config, which just switches env and appends node-specific rules.
# Current as of eslint 3.19.0
parserOptions:
ecmaVersion: 2017
sourceType: module
@bathos
bathos / clippen-majik.js
Created May 24, 2017 02:46
clippen-majik.js
document.querySelectorAll('canvas')[1].getContext('2d').drawImage = function(canvas) {
const downloadButton = document.getElementById('download');
const anchor = document.createElement('a');
anchor.download = 'poop.png';
anchor.innerText = 'POOP';
anchor.setAttribute('class', downloadButton.getAttribute('class'));
downloadButton.parentElement.replaceChild(anchor, downloadButton);
@bathos
bathos / urlchange.js
Created October 11, 2017 03:17
urlchange.js
// This module installs a custom global DOM event, 'urlchange', which is
// dispatched when the URL _semantically_ changes for any reason.
//
// It also alters URL behavior more generally. The URL is kept consistently in a
// canonical form, such that differences in the order of query parameters (other
// than same-key parameters, whose order is potentially meaningful) are
// eliminated. While the event is not fired on load, URL canonicalization may be
// performed.
//
// Like HashChangeEvent, URLChangeEvent has two properties, 'newURL' and