Skip to content

Instantly share code, notes, and snippets.

View pmrt's full-sized avatar

Pedro M. M. pmrt

  • Granada, Spain
View GitHub Profile
@pmrt
pmrt / PropDiff.js
Last active January 27, 2019 19:37
PropDiff
function isObject(exp) {
return typeof exp === 'object';
}
function isArray(exp) {
return Array.isArray(exp);
}
function isEqual(exp, older, newer) {
@pmrt
pmrt / findBlockRange.js
Last active March 10, 2019 21:48
find surrounding block ranges
function areSameBlock(a, b) {
a.getType() === b.getType()
}
function findBlockRange(contentState, areEqualFn, startBlock) {
const after = block => contentState.getBlockAfter(block.getKey())
const before = block => contentState.getBlockBefore(block.getKey())
const find = (block, nextBlock, directionFn) => {
if (!nextBlock || !areEqualFn(block, nextBlock)) {
Delivered-To: pedrojesusmartinez17@gmail.com
Received: by 2002:a17:90a:a383:0:0:0:0 with SMTP id x3csp4204415pjp;
Mon, 29 Apr 2019 15:08:03 -0700 (PDT)
X-Google-Smtp-Source: APXvYqxQvFrSVuxAHjJD5jeCeyGg8RPvDoQ0Rb3jUzjDZlyk8vU4+iufWJfM0ciNxqVPj3crxHrP
X-Received: by 2002:a5d:4f8b:: with SMTP id d11mr2782013wru.150.1556575683657;
Mon, 29 Apr 2019 15:08:03 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1556575683; cv=none;
d=google.com; s=arc-20160816;
b=MmvYSYUuZenzkljzCdmYEGUNLUkiMzTALen/uGentpvB8cAZsMKhNI9B7c/eRlY2C5
WuUfWHLG5dtB9rESuJ/mpCJRHsm3IHSsHnyth8CqvdpMl0UjlN4rFyUBmSItB9klv/QB
@pmrt
pmrt / crawler.js
Created May 7, 2019 11:52
crawler
const api = 'https://www.autodoc.es/ajax/selector/car_selector.json'
/*
error throws an error with a provided `msg`
*/
function error(msg) {
console.error(`Ha ocurrido un error: ${msg}`)
}
@pmrt
pmrt / appInfo.js
Created November 3, 2019 23:09
WhatsApp constants
// appInfo (for HKDF)
feacbgeaf: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.default = function(e, t) {
var n = function(e) {
return (0, i.default)(e, {
[u.default.AUDIO]: function() {
/*
Container es mejor que sea una clase, los id tienen prioridad absoluta y solo se suelen usar para un elemento
que vayas a usar en javascript en específico. Por ejemplo un vídeo.
Pon en el html todos los elementos con la clase .parrot y añade en la clase de parrot que quieras con .parrot-n
por ejemplo: <div class="parrot p-23"></div>. Si es dinámico con javascript mejor, para que puedas añador y quitar
fácilmente sin tener que tocar código.
*/
@pmrt
pmrt / commands.md
Last active November 6, 2020 22:41
Help: Available Commands for Eve Echoes Atlas

Help

Available Commands

set <property> <value>

Set changes the property <property> value to <value>. Typing set defaults will reset settings to default settings with no further confirmation. e.g. set font_size 12

Available properties:

  • font_size. Font size of rendered textboxs in map.
@pmrt
pmrt / catpuccino.js
Created February 17, 2022 20:09
Blinksh catpuccino
black = '#6E6C7E';
red = '#F28FAD'; // red
green = '#ABE9B3'; // green
yellow = '#FAE3B0'; // yellow
blue = '#96CDFB'; // blue
magenta = '#F5C2E7'; // pink
cyan = '#89DCEB'; // cyan
white = '#D9E0EE'; // light gray
lightBlack = '#988BA2'; // medium gray
lightRed = '#F28FAD'; // red
black = '#322e42';
red = '#d84f76'; // red
green = '#8aa872'; // green
yellow = '#e6a852'; // yellow
blue = '#4a869c'; // blue
magenta = '#a580d2'; // pink
cyan = '#7bb8c1'; // cyan
white = '#b1acde'; // light gray
lightBlack = '#393552'; // medium gray
lightRed = '#eb6f92'; // red
@pmrt
pmrt / rose-pine-v2.js
Last active June 12, 2022 19:06
BlinkShell Custom theme
const palette = {
base: "#191724",
surface: "#2a273f",
overlay: "#393552",
muted: "#6e6a86",
subtle: "#908caa",
text: "#e0def4",
love: "#eb6f92",
gold: "#f6c177",
rose: "#ea9a97",