Skip to content

Instantly share code, notes, and snippets.

View LC43's full-sized avatar
🏄‍♀️
Digital nomad

Pedro de Carvalho LC43

🏄‍♀️
Digital nomad
View GitHub Profile
anonymous
anonymous / aframe-pan.markdown
Created December 13, 2016 21:22
Aframe pan
anonymous
anonymous / aframe-pan.markdown
Created December 13, 2016 21:25
Aframe pan
{"lastUpload":"2019-07-20T19:25:54.246Z","extensionVersion":"v3.4.0"}
@HarishChaudhari
HarishChaudhari / cf7-custom-validation.php
Created November 5, 2014 08:08
Contact Form 7 custom validation
<?php
// Add custom validation for CF7 form fields
function custom_text_validation_filter($result,$tag){
$type = $tag['type'];
$name = $tag['name'];
$the_value = $_POST[$name];
if($name == 'firstname'){
if( empty($the_value) ) {
$result['valid'] = false;
@cgrymala
cgrymala / delete-plugin-tables.php
Created July 10, 2015 14:50
Delete Extra Plugin Tables When a Site Is Deleted in WordPress Multisite
<?php
/**
* Add any custom tables that this plugin creates for an individual site to the list
* of tables that get deleted when a site is deleted.
* @see https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-admin/includes/ms.php#L116
*/
add_filter( 'wpmu_drop_tables', 'delete_my_plugin_tables', 10, 2 );
function delete_my_plugin_tables( $tables=array(), $blog_id=null ) {
/**
* Make sure the blog ID parameter was sent, so we don't
@ginpei
ginpei / Gruntfile.js
Created December 17, 2012 02:00
`grunt.loadTasks('foo')` loads all JS files under directory `foo`, not `tasks/foo.js` with grunt v0.4.0rc2.
// ./Gruntfile.js
module.exports = function(grunt) {
grunt.loadTasks('hoge');
};
@didi0613
didi0613 / webpack4.md
Last active April 18, 2022 10:15
Migrate to Webpack 4

Upgrade to webpack 4

Config changes

Mode

  • Specify the mode (development/production) explicitly for running webpack.

Plugins

@v-jacob
v-jacob / Mailhog Bash Script (systemd)
Last active January 9, 2023 08:51
Mailhog setup with systemd
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O ~/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
# Make it executable
chmod +x ~/mailhog
@danielbachhuber
danielbachhuber / gist:9379135
Created March 5, 2014 23:43
Fix network admin URL to include the "/wp/" base
<?php
/**
* Fix network admin URL to include the "/wp/" base
*
* @see https://core.trac.wordpress.org/ticket/23221
*/
add_filter( 'network_site_url', function( $url, $path, $scheme ){
$urls_to_fix = array(
'/wp-admin/network/',
@ElfSundae
ElfSundae / git-checkout-all-branches.sh
Last active September 19, 2023 23:10
Git checkout all remote branches
#!/bin/bash
remote=origin ; for brname in `git branch -r | grep $remote | grep -v /master | grep -v /HEAD | awk '{gsub(/^[^\/]+\//,"",$1); print $1}'`; do git branch --track $brname $remote/$brname || true; done 2>/dev/null