Skip to content

Instantly share code, notes, and snippets.

@kwhitaker
kwhitaker / .git-stale
Last active May 4, 2020 19:10
Git delete stale local branches
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
/* ==UserStyle==
@name ProtonMail DeepDark
@namespace gitlab.com/RaitaroH/ProtonMail-DeepDark
@homepageURL https://gitlab.com/RaitaroH/ProtonMail-DeepDark
@version 1.0.4
@updateURL https://gitlab.com/RaitaroH/ProtonMail-DeepDark/raw/master/ProtonMail-DeepDark.user.css
@description Emails should be written and read in the dark. May the dark be kinder on thine eyes. (PrtonMail dark theme)
@author RaitaroH
@license GNU-V3.0
==/UserStyle== */
@kwhitaker
kwhitaker / theme.css
Created March 3, 2019 16:24
Proton Mail Bubblegum
/* =========================================== *
* DARK BUBBLE GUM THEME
* Version: 3.12.0
* Author: Cristiano Almeida
* Website: www.csalmeida.com
* Tweets @_csalmeida
* =========================================== */
.headerDesktop-container {
background-color: #1C1C1C;
}
module Story exposing (Model, init, view)
import Html exposing (Html, span, text)
type alias Model =
{ id : Int
, title: String
}
init : Int -> String -> Model
const config = Object.assign({}, require(`./webpack.${process.env.NODE_ENV}`), pkgOpts)
config.entry.push(`${pkg}/build/init`)
config.output.filename = `${pkg}.js`
config.plugins.push(
new HtmlWebpackPlugin({
favicon: 'src/favicon.ico',
title: pkgOpts.name || 'Needs a name',
})
)
const compiler = webpack(config)
@kwhitaker
kwhitaker / .block
Last active March 30, 2016 18:57 — forked from mbostock/.block
Wonky chrome animation
license: gpl-3.0
export function createCharacter(char) {
return dispatch => {
dispatch(submitCharacter(char));
return request.post('/new-character')
.send(JSON.stringify(char))
.then((response) => {
dispatch(routeToNewCharacter(response.body.id));
}, (error) => {
dispatch(receiveCharError(error.message));
});
@kwhitaker
kwhitaker / agent_interceptor.coffee
Created February 3, 2015 19:57
Decorator plugin for superagent.js, which lets you take actions on a response before the callback is fired.
# Use superagent's standard plugin architecture:
# superagent.get('/some/url').use(agentInterceptor).end(function(res){...});
agentInterceptor = (res) ->
Request = superagent.Request
oldCb = Request.prototype.callback
Request.prototype.callback = (err, r) ->
switch r.status
when 404
some404Func()
@kwhitaker
kwhitaker / DocCarousel.coffee
Created December 3, 2014 19:29
Slideshow/carousel plugin for jQuery
###
Multi-item carousel.
Written by Kevin Whitaker
Apply to a div to create a carousel out of a contained UL.
Animation is handled by CSS.
HTML structure looks like this:
<div id="#some-id">
<div class="carousel-wrap">
<ul class="carousel-list">
@kwhitaker
kwhitaker / gist:5438658
Created April 22, 2013 21:21
jsPlumb function that I'm having issues with
var adjustForParentOffsetAndScroll = function(xy, el) {
var offsetParent = null, result = xy;
if (el.tagName.toLowerCase() === "svg" && el.parentNode) {
offsetParent = el.parentNode;
}
else if (el.offsetParent) {
offsetParent = el.offsetParent;
}
if (offsetParent != null) {