Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
LeaVerou / gray.scss
Last active May 16, 2022 13:05
Polyfill gray() from CSS Color Level 4 with SASS
@function gray($intensity, $alpha: 1) {
@return rgba($intensity, $intensity, $intensity, $alpha);
}
/* Thanks Chris Eppstein for simplifying my code! */
/* Testing our new function */
body {
background: gray(50%);
background: gray(255, .2);
@tylersticka
tylersticka / .profile
Last active August 29, 2015 13:56
Helpful Pattern Lab aliases for your bash profile.
alias plbuild="php core/builder.php -gc" # Pattern Lab: Build/Clean
alias plwatch="php core/builder.php -rw" # Pattern Lab: Watch/Sync
The Challenge
-------------
Given the following riddle, write a regular expression describing all possible answers,
assuming you never make a move which simply undoes the last one you made.
The Riddle
----------
You are on your way somewhere, taking with you your cabbage, goat, and wolf, as always.
You come upon a river and are compelled to cross it, but you can only carry one of the
three companions at a time. None of them can swim because this isn't THAT kind of riddle.
@danklammer
danklammer / Flat Pinboard v1
Created February 2, 2014 21:16
A simple userstyle for pinboard.in bookmarking site
/* Theme Name: Flat Pinboard */
/* Theme URL: http://tackk.com/flat-pinboard */
/* Version: v1.0 */
/* Created by: Dan Klammer */
/* Broswer: Chrome + Stylish Extension */
html {
-webkit-font-smoothing:antialiased;
height:100%;
}
@aarongustafson
aarongustafson / backup.sh
Created January 22, 2014 19:43
Backup DB & files to Git You want these in a folder that is part of a sparse checkout.
#!/bin/bash
##
# Backup Folders to Git
#
# Creates a local cached backup of the source folder using rsync and then
# synchronises that and the database with Git.
#
# It is assumed you have rsync installed on the server.
#
@jenshandersson
jenshandersson / JAConcat.m
Created January 5, 2014 20:24
String concatenation in Objective-C, using one line of code. Takes a list of NSObject and concatenates their description.
#define $(...) ((NSString *)[[NSArray arrayWithObjects:__VA_ARGS__, nil] componentsJoinedByString:@""])
/*
* Example
*/
NSString *string = $(@"Hello", @" ", @"World!", @"\n", @"1 + 2 = ", @(1+2));
@0xabad1dea
0xabad1dea / dual-ec-but-biased.md
Created December 28, 2013 23:06
Dual EC, The Saga Continues: BUT MAYBE I'M BIASED

Dual EC, The Saga Continues: BUT MAYBE I’M BIASED

Bla bla bla this is my personal opinion bla bla bla.

Patents. Can’t live with violating them, can’t live without violating them. The entire concept of patented cryptography is a bit beyond what I have the energy to deal with right now. Whatever. We’re going in.

It didn’t click with me yesterday, reading the crypto news, that I had already quoted one Dan Brown with whom we are now concerned. No, not the one who wrote the novels. One of the other ones. I cited him in my timeline of trying to reconstruct where and when exactly Dual EC DRBG went so wrong. Specifically, the paper has a casual mention (bottom of page 7) that the proof of security relies on initialization value Q being random, because if it is not random, an adversary in-the-know can recover the prestates and everything’s downhill from there. Therefore – and I quote – it is generally preferable for Q to be c