Skip to content

Instantly share code, notes, and snippets.

Paul pablopaul

View GitHub Profile
purp /
Last active Jul 15, 2020
Debug Travis CI config locally using Docker

Debugging Travis CI locally using Docker

This assumes you've got docker-machine installed, running, and can do docker run

1. Get a debug instance running

    docker run --name travis-debug -dit /sbin/init
    docker exec -it travis-debug bash -l
dreyescat / index.html
Created Dec 18, 2015
Webpack config to expose bundle in a variable in the global context
View index.html
<script src="lib/yourlib.js"></script>
window.onload = function () {;
jbinto / index.jsx
Created Nov 28, 2015
Egghead tutorial - Getting Started with Redux - JSBin implementation
View index.jsx
/* global ReactRedux, Redux, ReactDOM */
// "Getting Started with Redux" (by Dan Abramov)
// This file on JSBin (by Jesse Buchanan):
ultimatemember / gist:5f093ac300baa1d2a5f1
Last active Oct 25, 2018
Example: block any registration that does not use @gmail as mail provider
View gist:5f093ac300baa1d2a5f1
The following code will require as domain
for user registrations.
You can change to any provider you want.
The code below requires a user email to be collected during registration
add_action('um_before_new_user_register', 'require_google_email_for_signup');
ultimatemember / gist:6c8d18b2b0869662d203
Last active Aug 29, 2015
Check when user updates e-mail via account page
View gist:6c8d18b2b0869662d203
add_action('um_account_pre_update_profile', 'did_user_change_email', 10, 2 );
function did_user_change_email( $changes, $user_id ) {
$data = get_userdata($user_id);
if ( isset( $changes['user_email'] ) && $data->user_email != $changes['user_email'] ) {
// user e-mail changed! Do something
agarzon / DbHelper.php
Last active Jul 21, 2020
Codeception DB helper to extend database functionalities (update & delete)
View DbHelper.php
namespace Codeception\Module;
* Additional methods for DB module
* Save this file as DbHelper.php in _support folder
* Enable DbHelper in your suite.yml file
* Execute `codeception build` to integrate this class in your codeception
SteveBenner / unbrew.rb
Last active Jul 13, 2020
Homebrew uninstall script
View unbrew.rb
#!/usr/bin/env ruby
# CLI tool for locating and removing a Homebrew installation
# Copyright (C) 2014 Stephen C. Benner
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
inspectorfegter / psuedo-static-js.php
Last active Apr 7, 2017
Add a pseudo static JS file to WordPress
View psuedo-static-js.php
#Add a query var to sniff requests
add_filter( 'query_vars', 'my_query_var_callback', 10, 1 );
function my_query_var_callback( $vars ){
$vars[] = 'dynamic_js';
return $vars;
#Dynamic JavaScript
add_rewrite_rule( '^assets/js/dynamic\.js$', 'index.php?dynamic_js=1', 'top' ); //Note the hidden query variable
# args
MSG=${1-'deploy from git'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
remy /
Last active Apr 27, 2020
My zsh set up as of July 25, 2013
#!/usr/bin/env python
# saved to ~/bin/ and from
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]
You can’t perform that action at this time.