Skip to content

Instantly share code, notes, and snippets.

Pablo Enrici pablen

Block or report user

Report or block pablen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pablen
pablen / .gitconfig
Last active Feb 4, 2019
Globally set git to sign commits. These lines must be present in your ~/.gitconfig
View .gitconfig
[user]
signingkey = YOUR_HEX_SIGNING_KEY
[commit]
gpgsign = true
[gpg]
program = /Applications/SourceTree.app/Contents/Resources/bin/stgpg.sh
@pablen
pablen / TP-Link_TD-W8960N_Reboot.sh
Last active Jan 11, 2019 — forked from sn1p3r46/TP-Link_TD-W8960N_Reboot.sh
This bash script reboots TP-Link routers
View TP-Link_TD-W8960N_Reboot.sh
@pablen
pablen / PubSub.js
Created Jan 13, 2018
React PubSub pattern
View PubSub.js
import React, { Component } from 'react';
import PubSub from 'pubsub-js';
class App extends Component {
state = { show: true };
render() {
return (
<div className="App">
<button onClick={() => this.setState(state => ({ show: !state.show }))}>
{this.state.show ? 'Hide panel' : 'Show panel'}
@pablen
pablen / day4.elm
Created Dec 4, 2017
Advent of Code. Day 4. Part 2.
View day4.elm
module Main exposing (..)
import Html exposing (text)
import Set
input : String
input =
"""pphsv ojtou brvhsj cer ntfhlra udeh ccgtyzc zoyzmh jum lugbnk
{-- more lines... --}
@pablen
pablen / Main.elm
Last active Jan 24, 2019
DOM mutation observer helper that will run a hook when a DOM node matching a selector is mounted or unmounted. This pattern is particularly useful for working with external JS libraries in your Elm apps, using minimal amount of code. The helper leverages the MutationObserver API (https://developer.mozilla.org/es/docs/Web/API/MutationObserver).
View Main.elm
-- Somewhere in you Elm app you can add editor by adding an empty node with the correct attributes.
-- The JS library will be initialized and destroyed automatically!
view : Model -> Html Msg
view model =
div []
[ div
[ attribute "data-ace" ""
, attribute "data-ace-theme" "monokai"
, attribute "data-ace-mode" "javascript"
@pablen
pablen / AsyncContent.js
Last active Sep 24, 2015
Carga de contenido adicional asincrónica y condicional en base al ancho del viewport.
View AsyncContent.js
(function(window, document, undefined){
"use strict";
var config = {
selector : "[data-asynccontent-url]",
urlAttr : "data-asynccontent-url",
thrAttr : "data-asynccontent-threshold",
loadTxtAttr : "data-asynccontent-loadtxt",
defaultLoadTxt : "Obteniendo contenido..."
},
You can’t perform that action at this time.