Skip to content

Instantly share code, notes, and snippets.

View andion's full-sized avatar
🐶

Lucas Andión Montáns andion

🐶
View GitHub Profile
@gaearon
gaearon / slim-redux.js
Last active December 3, 2024 06:34
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@davidbarral
davidbarral / npmenv.completions.fish
Last active November 22, 2017 10:36
Poor man npmenv solution for fish (Use multiple .npmrc profiles)
# Completions for npmenv.fish
function __fish_npmenv_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'npmenv' ]
return 0
end
return 1
end
@alana314
alana314 / testheadphones.sh
Created March 21, 2019 17:59
Test if headphones are plugged in -- OS X shell script
#!/bin/bash
if system_profiler SPAudioDataType | grep --quiet Headphones; then
echo plugged in
else
echo not plugged in
fi
@JaimeObregon
JaimeObregon / observatorios.txt
Last active March 19, 2024 21:35
Pero, ¿cuántos observatorios financiados con dinero público hay en España?
Observatori Municipal de l'Habitatge d'Alcoi
Observatorio Autonómico dos Ríos de Galicia
Observatorio da Sociedade da Información e a Modernización de Galicia
Observatorio da Violencia no Contorno Laboral
Observatorio de Administración Electrónica
Observatorio de Igualdad de Oportunidades entre Mujeres y Hombres
Observatorio de la Cadena Alimentaria
Observatorio de la Ciencia Ciudadana
Observatorio de la Gestión Empresarial en Biodiversidad
Observatorio de la Infancia de España