Skip to content

Instantly share code, notes, and snippets.

@tancredi
tancredi / boom.js
Created December 11, 2013 00:08
Node.js Super Mario build complete ASCII log
module.exports = function () {
console.log(
' \n\n' +
' ███████ ███████\n' +
' ████------████ ██\n' +
' ██------------██ ██\n' +
' ██------████████████ ██\n' +
' ██------████████████████ ██\n' +
' ██--████ ██████\n' +
' ████████ ██ ██ ██----██ ██████████████████████████████████████████████\n' +
@tancredi
tancredi / boom.coffee
Last active December 30, 2015 23:49 — forked from adlawson/boom.js
module.exports = -> console.log '''
███████ ███████
████------████ ██
██------------██ ██
██------████████████ ██
██------████████████████ ██
██--████ ██████
████████ ██ ██ ██----██ ██████████████████████████████████████████████
██ ████ ██ ██ ██----██ ██ ██
@tancredi
tancredi / extend.js
Last active January 2, 2016 09:59
Quick, stand-alone deep extend implementation
function extend () {
var out = arguments[0],
i, key, obj, val;
for (i = 1; i < arguments.length; i += 1) {
obj = arguments[i];
for (key in obj) {
if (obj.hasOwnProperty(key)) {
val = obj[key];
'strict mode'
const fs = require('fs')
const path = require('path')
/**
* Re-prefix utility
*
* Usage: re-prefix [ dir ] [ prefix ] [ new_prefix ]
* E.g. re-prefix ./icons soc- social-icon-
#!/bin/bash
###################################################################
## Usage: ./indent_4_to_2_spaces.sh lib/**/*.js www/css/**/*.css ##
###################################################################
echo Re-indenting ${$#-2} files from 4 to 2 spaces...
for (( i=1; i<=$#; i++ )); do
sed -e 's/^/~/' -e ': r' -e 's/^\( *\)~ /\1 ~/' -e 't r' -e 's/~//' ${!i} > ${!i}.tmp && mv ${!i}.tmp ${!i}
@tancredi
tancredi / browser.js
Last active February 14, 2018 10:03
Pointer-events IE polyfill (vanilla JS)
/**
* Browser utility
*
* Exports utility methods to detect browser types and versions from userAgent
*/
/**
* Returns true if is IE browser equal or below given version
*
* @param {Number} version
@tancredi
tancredi / long-shadow.styl
Created March 16, 2015 14:21
Long shadow Stylus mixin
// Stylus version of SCSS mixin from http://codepen.io/awesomephant/pen/mAxHz
long-shadow(type = 'box', base-color = rgba(#000, .2), length = 100, fadeout = true, skew = false, direction = 'right')
shadow = ''
if !skew || type == 'text'
if direction == 'right'
for i in (0..length - 1)
shadow = shadow + i + 'px ' + i + 'px 0 ' + base-color + ','
@tancredi
tancredi / paste-me-in-the-console.js
Created November 22, 2018 14:28
Export / Import GitHub tags (browser script)
function rgbToHex(color) {
const [ r, g, b ] = color.substring(4, color.length - 1).split(', ');
return '#' + [ r, g, b ].map(x => {
const hex = parseInt(x).toString(16);
return hex.length === 1 ? '0' + hex : hex
}).join('');
}
#include <HSBColor.h>
#include <Adafruit_NeoPixel.h>
#define BUTTON_PIN 3
#define MODES_COUNT 7
#define LED_PIN 6
#define LED_COUNT 4
int mode = 0;
bool modeButtonPressed = false;
@tancredi
tancredi / sublime-text-logo.svg
Last active October 28, 2020 05:32
SublimeText simplified logo (SVG)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.