Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
@DeviaVir
DeviaVir / dabblet.css
Created May 11, 2013 17:18
Circular Tooltip (SO)
/**
* Circular Tooltip (SO)
* http://stackoverflow.com/q/13132864/1397351
*/
* { margin: 0; padding: 0; }
body {
overflow: hidden;
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg);
}
/* generic styles for button & circular menu */
.parallax-image {
background: url() repeat center center fixed;
background-clip: padding-box;
}
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
@DeviaVir
DeviaVir / dabblet.css
Created January 5, 2015 11:17 — forked from LeaVerou/dabblet.css
The cicada principle in animations
/**
* The cicada principle in animations
* Remember the cicada principle that used prime numbers to make multiple overlaid repeated backgrounds seem more random?
* There’s no reason it can’t be applied to repeating linear animations too (using primes for the durations, divided by 10)
*/
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes radius { 50% { border-radius: 50%; } }
@keyframes color { 50% { color: orange; } }
@keyframes width { 50% { border-width: .3em; } }
// Double all numbers
> Promise.map([1, 2, 3], function(num) { return num * 2; }).then(function(numbers) { console.log("The final list of numbers:", numbers); })
The final list of numbers: [ 2, 4, 6 ]
// Remove all the odd numbers
> Promise.filter([1, 2, 3], function(num) { return (num % 2) == 0; }).then(function(numbers) { console.log("The final list of numbers:", numbers); })
The final list of numbers: [ 2 ]
// Sum all the numbers
> Promise.reduce([1, 2, 3], function(total, num) { return total + num; }, 0).then(function(number) { console.log("The final value:", number); })
resource "aws_iam_user" "asg_healthreport" {
name = "${var.stack}-asg_healthreport"
# can't use create_before_destroy due to fixed name
}
resource "aws_iam_access_key" "asg_healthreport" {
user = "${aws_iam_user.asg_healthreport.name}"
# can't use create_before_destroy due to fixed name of user
}
#!/usr/bin/perl -w
# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn).
#
# See:
# runtime/queue.c: qqueuePersist()
# runtime/queue.c: qqueueTryLoadPersistedInfo()
#
# [email protected] 2012-03-14
#
use strict;