Skip to content

Instantly share code, notes, and snippets.

View aitormendez's full-sized avatar

Aitor Méndez aitormendez

  • Madrid
View GitHub Profile
export default class EventEmitter
{
constructor()
{
this.callbacks = {}
this.callbacks.base = {}
}
on(_names, callback)
{
@cfaria
cfaria / ThemeServiceProvider.php
Last active February 2, 2024 20:44
Prevent E_NOTICE, E_WARNING, E_DEPRECATED errors WSOD in Sage 10
<?php
namespace App\Providers;
use Roots\Acorn\ServiceProvider;
class ThemeServiceProvider extends ServiceProvider
{
/**
* Register any application services.
@ayyybe
ayyybe / ccdl.command
Last active April 9, 2024 09:04
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
# group_vars/{staging & production}/wordpress_sites.yml
[...]
wordpress_sites:
example.com:
site_hosts: [...]
[...]
matomo:
db:
user: matomo
host: localhost
@E-VANCE
E-VANCE / acf-basic.php
Last active December 14, 2019 08:28
ACF Builder (Basic fields)
<?php
/**
* BASIC -- Header image
*/
$basic_page_header = new FieldsBuilder('basic_page_header');
$basic_page_header
->addImage('page_header_background_image')
->addText('page_header_title', [
'instructions' => 'Leave empty to use the site title / name',
@companje
companje / map.glsl
Created January 23, 2018 22:46
map() function for GLSL known from Processing & openFrameworks
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
@lewislepton
lewislepton / glsl.json
Last active April 20, 2024 18:15
GLSL snippets for visual studio code/kode studio
/*
AUTO-COMPLETE SNIPPETS FOR GLSL WITHIN VISUAL CODE STUDIO
Lewis Lepton
https://lewislepton.com
useful places that i grabbed info from
http://www.shaderific.com/glsl
https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language
plus various other papers & books
*/
{{--
Template Name: Events
--}}
@extends('layouts.app')
@section('content')
<div id="tribe-events-pg-template">
<?php tribe_events_before_html(); ?>
<?php tribe_get_view(); ?>
@retlehs
retlehs / sync-prod.sh
Last active January 26, 2022 03:48
WP-CLI aliases sync example
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
wp @development db reset --yes &&
wp @production db export - > sql-dump-production.sql &&
wp @development db import sql-dump-production.sql &&
wp @development search-replace https://example.com https://example.dev
fi