Skip to content

Instantly share code, notes, and snippets.

View mvaneijgen's full-sized avatar

Mitchel van Eijgen mvaneijgen

View GitHub Profile
<?php
/**
* No Search Results Feedback Part
*
* @package bbPress
* @subpackage Theme
*/
?>
-- delete any usermeta specific to the other subsites
delete from wp_usermeta where meta_key regexp '^wp_([0-9]+)_';
-- duplicate the wp_usermeta structure in a working data table,
-- but add a unique index for filtering out duplicates
create table _fix_usermeta like wp_usermeta;
alter table _fix_usermeta add unique(user_id, meta_key);
-- copy the site-specific usermeta, keeping only the last of each duplicate
insert into _fix_usermeta
li.filterall.filter-blog.eg-mve-custom-wrapper.eg-post-id-491.tp-esg-item.itemtoshow.isvisiblenow
@mvaneijgen
mvaneijgen / SafariPrivate.scpt
Last active August 29, 2015 14:24
Open Safari Private tab
tell application "Safari"
activate
end tell
tell application "Safari"
activate
end tell
tell application "System Events"
tell process "Safari"
options =
city : "Haarlem" # default city in case location detection fails
region : "NH" # default region in case location detection fails
units : 'c' # c for celcius. f for Fahrenheit
staticLocation: false # set to true to disable autmatic location lookup
appearance =
iconSet : 'original' # "original" for the original icons, or "yahoo" for yahoo icons
color : '#fff' # configure your colors here
darkerColor : 'rgba(#fff, 0.8)'
command: "ps axro \"pid, %cpu, ucomm\" | awk 'FNR>1' | head -n 3 | awk '{ printf \"%5.1f%%,%s,%s\\n\", $2, $3, $1}'"
refreshFrequency: 20000
style: """
bottom: 30px
left: 30px
color: #fff
font-family: Helvetica Neue
@mvaneijgen
mvaneijgen / style.css
Created August 14, 2015 12:16
Quick build dark theme for the Evernote web client use something like Chrome [Stylebot](https://chrome.google.com/webstore/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha?hl=en) to load this.
.GGAE30MDLFC, .GGAE30MDCCB, div#gwt-debug-NotesView-root, .GGAE30MDBTB, div#gwt-debug-MetaBarView-root, .GGAE30MDHIB {
background-color: #444;
}
.GGAE30MDC3B, .GGAE30MDO1, div#gwt-debug-NoteView-root, .GGAE30MDDGB, div#gwt-debug-MetaBarView-root, .GGAE30MDHIB {
background-color: #888;
}
.GGAE30MDERB, .GGAE30MDIQB, input#gwt-debug-NotebooksDrawer-drawerFilter-textBox, .GGAE30MDCCB, .GGAE30MDF1, .GGAE30MDFJB, .GGAE30MDHJB, .GGAE30MDJKB, .GGAE30MDHFB, .GGAE30MDF1B, .GGAE30MDAUB, .GGAE30MDAQ.GGAE30MDGQ .GGAE30MDFQ, .GGAE30MDLQ {
border-color: #333 ;
@mvaneijgen
mvaneijgen / functions.php
Created August 31, 2016 13:01
Create custom Events view in the wp-admin, but not jet found how to load custom template files
<?php
add_filter( 'tribe-events-bar-views', 'my_setup_view_for_bar', 10);
function my_setup_view_for_bar( $views ) {
$tec = Tribe__Events__Main::instance();
$views[] = array('displaying' => 'grid', 'anchor' => 'Grid', 'url' => $tec->getOption( 'eventsSlug', 'events' ) . '/grid' );
return $views;
}
@mvaneijgen
mvaneijgen / menukaart.php
Last active September 8, 2016 19:06
Loop though post that have multiple specific terms from multiple taxonamies
<?php $soorts = get_terms('soort'); if ( ! empty( $soorts ) && ! is_wp_error( $soorts ) ) : ?>
<?php foreach ( $soorts as $soort ) : ?>
<div class="owl-menukaart__inner" data-hash="<?php echo $soort->slug; ?>">
<div class="menukaart__inner">
<div class="title-container">
<h1><?php echo $soort->name; ?></h1>
</div>
<div class="container">
<?php $lands = get_terms('land'); if ( ! empty( $lands ) && ! is_wp_error( $lands ) ) : ?>
@mvaneijgen
mvaneijgen / menu.html
Last active September 12, 2016 08:15
<ul class="jre-menu">
<li>
<h3 class="alloy-title">Menu naam #1</h3>
<p>8 gangen</p>
<span>€ 85 <b>€ 145</b></span>
</li>
<li>
<h3 class="alloy-title">Menu naam #2</h3>
<p>7 gangen</p>
<span>€ 75 <b>€ 132</b></span>