Skip to content

Instantly share code, notes, and snippets.

View bramchi's full-sized avatar

Bram Perry bramchi

View GitHub Profile
@bramchi
bramchi / searchform.php
Last active November 1, 2022 12:07
Roots.io searchform.php template hack to get search widget working in Polylang, only searching within the active language. 'soil-nice-search' disabled btw.
<?php
/*
*
* Roots.io searchform.php template hack to fix Polylang search
*
* Note: Polylang setting 'Hide URL language info for default language' should be enabled for this to work.
* Soil-nice-search disabled in Roots.
*
*/
@bramchi
bramchi / get_orders_with_appointment.php
Last active October 30, 2020 08:34
Get all WooCommerce orders from Wordpress that have a Local Pickup Plus appointment
function get_orders_with_pickup_appointment() {
global $wpdb;
$sql = "
SELECT
`items`.`order_id`
FROM
`{$wpdb->prefix}woocommerce_order_items` AS `items`
INNER JOIN
@bramchi
bramchi / export-microsoft-to-do-list.js
Last active May 15, 2018 17:25
Copy a Microsoft To-Do list from the webapp to your clipboard in plaintext
/*
Paste this in your javascript console at https://todo.microsoft.com
The texts will then land on your clipboard, so you can paste them into
another todo app like todoist, that will pickup multiple tasks based on the new lines
*/
var nodes = document.querySelectorAll('.taskItem-title');
var list = [].slice.call(nodes);
@bramchi
bramchi / 0-react-hello-world.md
Last active February 6, 2018 01:27 — forked from danawoodman/0-react-hello-world.md
React Hello World Examples
{
"editor.fontSize": 15,
"workbench.sideBar.location": "left",
"workbench.activityBar.visible": true,
"workbench.colorTheme": "One Monokai",
// "editor.fontFamily": "Source Code Pro, Menlo, Monaco, 'Courier New', monospace",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.minimap.enabled": false,
"editor.scrollbar.horizontal": "hidden",
@bramchi
bramchi / css-svg-data-bg.css
Last active April 6, 2016 16:40
Use a compressed SVG image directly as CSS background image. SVGOMG / https://jakearchibald.github.io/svgomg/ is awesome for SVG compression by the way.
a.nav-social-link.-facebook {
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M11.133 6h-2.09V4.718c0-.482.342-.593.582-.593H11.1V2.008L9.07 2C6.816 2 6.303 3.58 6.303 4.59V6H5v2.18h1.303v6.172h2.74v-6.17h1.85L11.134 6z" fill="%231D1C1B" fill-rule="evenodd"/></svg>');
}
@bramchi
bramchi / active-media-query-helper.scss
Created March 20, 2016 20:01
A little helper snippet to complement the visual-grid in Bourbon Neat. It shows what media query is currently active, using a little label in the bottom right corner.
// Set visual-grid in _grid-settings.scss for a nice grid overlay
@if ($visual-grid) {
body:after {
display: block;
position: fixed;
bottom: 0;
right: 0;
font-size: 12px;
background-color: darkred;
color: white;
@bramchi
bramchi / Run project script
Created July 9, 2014 19:07
This applescript is a nice way to start up a local development project. It opens two finder tabs, runs the local webserver, opens the corresponding sublime text project, runs grunt and opens the local url in Google Chrome.
tell application "Terminal"
do script "open /Users/bram/Dropbox/Projecten/Stagewerkt.nl && open /Users/bram/Sites/stagewerkt.nl/wp-content/themes/stagewerkt-2 && http start && cd /Users/bram/Sites/stagewerkt.nl/wp-content/themes/stagewerkt-2 && subl --project stagewerkt && grunt watch"
end tell
tell application "Google Chrome"
open location "http://www.stagewerkt.dev/"
end tell