Skip to content

Instantly share code, notes, and snippets.

View DrummerHead's full-sized avatar
💭
Eternally Elated

DrummerHead DrummerHead

💭
Eternally Elated
View GitHub Profile
@DrummerHead
DrummerHead / .htmlhintrc
Last active March 7, 2017 09:23 — forked from thorade/.htmlhintrc
HTMLHint rules
{
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": false,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"doctype-first": true,
"tag-pair": true,
"tag-self-close": false,
"spec-char-escape": true,
@DrummerHead
DrummerHead / index.html
Last active February 29, 2016 20:12
made.com.uy
<!DOCTYPE html>
<html>
<head>
<title>Martín Lorenzo</title>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="image/x-icon" rel="shortcut icon" href="http://www.made.com.uy/images/favicon.ico">
<style>
html {
@DrummerHead
DrummerHead / analyze-launchctl-list
Created March 8, 2016 19:06
See what services you have running and remove any offenders ( more info: http://osxdaily.com/2011/03/08/remove-an-agent-from-launchd/ )
#!/usr/bin/env ruby
launch_data = %x[launchctl list].split("\n").drop(1)
launch_data_details = launch_data.map do |line|
line_data = line.split("\t")
{
pid: line_data[0],
status: line_data[1],
label: line_data[2]
}
#!/usr/bin/env ruby
require 'shellwords'
wavs = Dir.glob("**/*.wav", File::FNM_CASEFOLD)
mp3s = Dir.glob("**/*.mp3", File::FNM_CASEFOLD)
puts "\n\n=================\n\n"
puts wavs
// Use this script on your
// preferred modern browser console
const meme = (text) => {
return [...text.toUpperCase()].reduce((prev, curr, i, ary) => {
return [`${prev[0]}${ary[i]} `, `${prev[1]}\n${ary[i + 1] || ''} `];
}, ['','']).reduce((prev, curr) => prev + curr);
};
const result = meme('Aesthetics');
@DrummerHead
DrummerHead / gen-task
Created October 11, 2016 13:37
Write a markdown file for documenting the tasks of the day
#!/usr/bin/env ruby
require 'time'
def titleForMd argument
argument ? " - #{argument}" : ''
end
def titleForFilename argument
argument ? argument.gsub(/\s/, '-') : 'tasks'
@DrummerHead
DrummerHead / prepend-exif-date.rb
Last active March 15, 2018 16:16
Prepend exif date to file name
#!/usr/bin/env ruby
# Place this script in a folder full of images.
# After execution, it will rename all image files,
# prepending the date of shot taken to the
# original file name.
# https://github.com/tonytonyjan/exif
# gem install exif
// Clap text generator
// ===================
// ## Function
//
const clapText = (text, { uppercase = false, tight = false } = {}) => {
const space = tight ? '' : ' ';
const newText = uppercase ? text.toUpperCase() : text;
return newText.replace(/\s/g, `${space}👏${space}`);
}

Como aprendí react

Aloha! Estos son artículos que leí que me ayudaron a agarrarle la mano a React. Leí bastantes cosas pero estas creo que encaran bastante, vamo!

Este articulo no te explica directamente React, sino que arranca a hacer un framework de juguete desde cero que cumple con la filosofía de React, y te va explicando por qué encara esto y no lo otro. Es como una especie de "te voy a explicar por qué el framework es así" y me parece que encara porque en vez de simplemente aceptar las cosas, ya de entrada podes aprender los motivos detrás de como son las cosas. Además tiene ejemplos en vivo y toda la magia, ta bueno.

@DrummerHead
DrummerHead / getStarsOnTheFly.js
Last active September 24, 2017 21:13
See github stars on a list of projects
// On this URL
// https://github.com/markerikson/redux-ecosystem-links/blob/master/routing.md
// or this:
// https://github.com/MicheleBertoli/css-in-js
// or any place with links to a github repo;
// go to developer console and run:
const fetchStars = url => {
const [, user, repo] = url.match(/https:\/\/github.com\/([^\/]*)\/(.*)\/?$/);
return fetch(`https://api.github.com/repos/${user}/${repo}`)