Skip to content

Instantly share code, notes, and snippets.

@aristretto
aristretto / base 64 convert
Created April 10, 2014 05:46
cmd line convert image to base64 and copy to clipboard
cat /path/to/img.png | openssl base64 | tr -d '\n' | pbcopy
@aristretto
aristretto / test.js
Last active October 4, 2017 21:10
test.js
console.warn('foo');
function bar() {
console.log('bar!');
};

Keybase proof

I hereby claim:

  • I am aristretto on github.
  • I am aristretto (https://keybase.io/aristretto) on keybase.
  • I have a public key ASBofRw6rNNtjFFEtA8sK6SzeNOHIzknNlZL5pNjg-i6ZAo

To claim this, I am signing this object:

@aristretto
aristretto / console-vote-message.js
Created November 8, 2016 19:46
Paste this in your JS console (in Chrome)
!(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) ? null : (function() {
var args = [], eightBitHack = [], coordinates = ["nodcnp", "tl9ehx", "tl9fad", "tl9fad", "tl9fhh", "tl9fj9", "zik0z9", "zik0zh", "zik0zj", "zik0zh", "zik0z9", "tl9fj9", "tl9fhh", "tl9fad", "tl9fad", "tl9ehx", "nodcnp"];
for (var row = coordinates.length; row--;) {
var decompressedRow = parseInt(coordinates[row], 36).toString(4).split('');
coordinates[row] = decompressedRow.splice(1, decompressedRow.length-1);
for (var cell = coordinates[row].length; cell--;) {
var dot = parseInt(coordinates[row][cell]);
var color = dot === 3 ? '#c32733' : dot === 2 ? '#1155cc' : dot ? '#fff' : null;
args.unshift("border: 8px solid color;".replace('color', color));
eightBitHack.unshift("%c");
@aristretto
aristretto / SassMeister-input-HTML.html
Last active April 8, 2016 16:20
Generated by SassMeister.com.
<div class="zenefits-logo">
<div class="piece wing-back"></div>
<div class="piece head"></div>
<div class="piece wing-front-1"></div>
<div class="piece wing-front-2"></div>
<div class="piece tail"></div>
</div>
@aristretto
aristretto / counters.css
Last active December 17, 2015 13:09
CSS Counters, basic tidbits
/*
* more helpful links
* http://www.w3.org/TR/CSS2/generate.html#scope
* http://quirksmode.org/css/css2/counter.html
* http://www.impressivewebs.com/css-counter-increment/
*/
/* decimal counters (basic, default) */
@aristretto
aristretto / placeholder.scss
Last active December 14, 2015 22:39 — forked from antsa/placeholder.scss
A mixin to style placeholders in HTML5 form elements. Requires Sass 3.2.
$placeholders: '-webkit-input-placeholder',
'-moz-placeholder',
'-ms-input-placeholder';
@mixin placeholder {
@each $placeholder in $placeholders {
@if $placeholder == "-webkit-input-placeholder" {
&::#{$placeholder} {
@content;
@aristretto
aristretto / truncateURI.js
Last active December 12, 2015 10:19
The purpose of this ditty is to truncate URIs in a more elegant way. ** I'm not a regex pro, be gentle :)
// truncate URIs in a more elegant way
String.prototype.truncateURI = function(n, backup){
var len = this.length;
var self = this.toString();
var max_len = (n||30);
var fallback = (backup||"website")
var patt = /^(https?\:\/\/)?(www\.)?([a-z0-9\-\_]+)([a-z\.]{2,})+([a-z0-9\-\_\#\/ ]+\/)?([a-z0-9\-\_\#\/]+\.?[a-z0-9]+)?/i
/*** PATTERN BREAKDOWN ***
@aristretto
aristretto / SassMeister-input-HTML.html
Created July 7, 2015 07:02
Generated by SassMeister.com.
<div class="zenefits-logo">
<div class="piece wing-back"></div>
<div class="piece head"></div>
<div class="piece wing-front-1"></div>
<div class="piece wing-front-2"></div>
<div class="piece tail"></div>
</div>