Skip to content

Instantly share code, notes, and snippets.

View drrobotnik's full-sized avatar

Brandon drrobotnik

  • ThermoFisher Scientific
  • San Diego
View GitHub Profile
from collections import Counter
import argparse
import fnmatch
import os
import sys
from bs4 import BeautifulSoup
matches = []
elements = {}
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
device-metrics-us.amazon.com
samsungacr.com
samsungcloudsolution.com
samsungcloudsolution.net
pavv.co.kr
samsungotn.net
@drrobotnik
drrobotnik / wp-autoloader.php
Created December 11, 2014 20:50
wp plugin autoloader
<?php /*
Plugin Name: WP Plugin Autoloader
Plugin URI: http://www.caavadesign.com
Description: Proposed usage of a WP autoloader
Version: 0.0.1
Author: Brandon Lavigne
*/
# Plugin Autoloader
@drrobotnik
drrobotnik / widget.php
Created March 5, 2014 09:10
widget w/repeater field
<?php
class Nama_Widget_Classes extends WP_Widget {
/*--------------------------------------------------*/
/* Constructor
/*--------------------------------------------------*/
/**
* Specifies the classname and description, instantiates the widget,
function wp_nav_menu_items_filter($items, $args){
global $sitepress_settings, $sitepress;
$current_language = $sitepress->get_current_language();
$default_language = $sitepress->get_default_language();
// menu can be passed as integer or object
if(isset($args->menu->term_id)) $args->menu = $args->menu->term_id;
$abs_menu_id = icl_object_id($args->menu, 'nav_menu', false, $default_language );
.intro {
display: -ms-flexbox;
display: flex;
-ms-flex-direction: row;
flex-direction: row;
text-align: center;
color: #fff;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
@drrobotnik
drrobotnik / wp-config.php
Created May 13, 2014 22:41
master-config
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information by
* visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@drrobotnik
drrobotnik / gist:4562249
Created January 18, 2013 04:00
Modified snippet from Kovshenin. echoing out a multisites list of subdomains for easy copy pasting into your local hosts file.
/* Repurposed from: http://kovshenin.com/2012/wordpress-multisite-with-wildcard-subdomains/
** I found that giving each subdomain their own entry ran significantly faster.
*/
add_action( 'wp_footer', 'print_entry_for_hosts_file' );
function print_entry_for_hosts_file() {
global $wpdb;
$domains = $wpdb->get_col( "SELECT domain FROM $wpdb->blogs;" );
foreach($domains as $domain){
echo "127.0.0.1 " . $domain . "\n";
@drrobotnik
drrobotnik / css.css
Last active May 13, 2016 16:56
gmen
li.g-menu-item.active .g-dropdown {
top: auto !important;
visibility: visible !important;
opacity: 1 !important;
}
@drrobotnik
drrobotnik / gist:09a539f1e8ef705cc7110562baed575a
Created April 22, 2016 18:22
git pull recursively from one level above
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git rev-parse --verify staging && if [ -n "$?" ]; then ggl; fi" \;