Skip to content

Instantly share code, notes, and snippets.

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

Chase DeviaVir

🏴‍☠️
View GitHub Profile
#!/usr/bin/perl -w
# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn).
#
# See:
# runtime/queue.c: qqueuePersist()
# runtime/queue.c: qqueueTryLoadPersistedInfo()
#
# kaiwang.chen@gmail.com 2012-03-14
#
use strict;
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
}
// 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); })
@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; } }
#! /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
.parallax-image {
background: url() repeat center center fixed;
background-clip: padding-box;
}
@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 */
@DeviaVir
DeviaVir / dabblet.css
Created September 20, 2012 01:27 — forked from marciobarrios/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@DeviaVir
DeviaVir / dabblet.css
Created August 21, 2012 21:55 — forked from JoelBesada/dabblet.css
CSS States
/* CSS States */
body {
background: url(http://dabblet.com/img/noise.png);
background-color: #F5F2F0;
font-family: Georgia, serif;
font-size: 18px;
line-height: 1.6em;
text-shadow: 0 2px 0 white;
color: #222;
}
@DeviaVir
DeviaVir / dabblet.css
Created May 14, 2012 07:20 — forked from LeaVerou/dabblet.css
Text masking — The SVG way
/**
* Text masking — The SVG way
*/
svg {
width: 6em; height: 1.5em;
font: 900 500%/1.2 'Arial Black', sans-serif;
}
text { fill: url(#wood); }