Skip to content

Instantly share code, notes, and snippets.

View rbndelrio's full-sized avatar

Ruben Del Rio rbndelrio

  • Springer-Nature / Scientific American
  • New York, New York
  • 04:14 (UTC -04:00)
View GitHub Profile
@homerjam
homerjam / mc-section.js
Created January 11, 2017 12:57
Custom MJML component for use in MailChimp templates
import { MJMLElement, helpers } from 'mjml-core'
import cloneDeep from 'lodash/cloneDeep'
import merge from 'lodash/merge'
import React, { Component } from 'react'
const tagName = 'mc-section'
const parentTag = ['mj-container']
const defaultMJMLDefinition = {
attributes: {
'mc:hideable': null,
@peterdemartini
peterdemartini / command.sh
Last active May 20, 2024 11:04
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@omurphy27
omurphy27 / echo-enqueued-styles-scripts-wordpress.php
Last active March 8, 2024 07:19
Wordpress - Print Out All Enqueued Scripts And Styles On A Page
<?php
// add the below to your functions file
// then visit the page that you want to see
// the enqueued scripts and stylesheets for
function se_inspect_styles() {
global $wp_styles;
echo "<h2>Enqueued CSS Stylesheets</h2><ul>";
foreach( $wp_styles->queue as $handle ) :
echo "<li>" . $handle . "</li>";
///////////////////////////
// ES6 original
////////////////////////////
class A extends B {
constructor(x) {
this.x = x;
}
b() {return this.x};
}
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@kriegsman
kriegsman / TwinkleFOX.ino
Last active January 9, 2024 02:20
TwinkleFOX: Colored Twinkling Holiday Lights
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@mattdesl
mattdesl / fancy.frag
Last active May 8, 2022 07:11
how we're currently using glslify + ThreeJS
varying vec2 vUv;
uniform sampler2D tDiffuse;
uniform sampler2D tColorLUT;
uniform vec2 resolution;
#pragma glslify: blendOverlay = require(./glsl-blend-overlay)
#pragma glslify: displace = require(./glsl-displace)
#pragma glslify: srcOver = require(./glsl-src-over)
#pragma glslify: colorCorrect = require(glsl-lut/flipY)
@wturrell
wturrell / popular-posts.php
Created March 14, 2014 12:33
Wordpress & Google Analytics - retrieve most popular posts
@gregrickaby
gregrickaby / grd_functions.php
Last active April 10, 2018 02:38
A "must use" plugin to help save theme-agnostic functions
<?php
/**
* Must-Use Functions
*
* A class filled with functions that will never go away upon theme deactivation.
*
* @package WordPress
* @subpackage GRD
*/
class GRD_Functions {