Skip to content

Instantly share code, notes, and snippets.

@Bicarbona
Bicarbona / workbench.colorCustomizations.json
Created April 9, 2024 10:17 — forked from dcts/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@Bicarbona
Bicarbona / write_to_clipboard.py
Created April 5, 2023 16:35 — forked from luqmaan/write_to_clipboard.py
Write a python string to the clipboard via pbcopy (OS X)
def write_to_clipboard(output):
import subprocess
process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE)
process.communicate(output.encode())
@Bicarbona
Bicarbona / woocommerce-select2-selectwoo-remove
Created November 17, 2019 18:58 — forked from ontiuk/woocommerce-select2-selectwoo-remove
Woocommerce Remove Select2 / SelectWoo
// Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting
/**
* Remove Woocommerce Select2 - Pre WC 3.2.1-ish
*/
function woo_dequeue_select2() {
if ( class_exists( 'woocommerce' ) ) {
wp_dequeue_style( 'select2' );
wp_deregister_style( 'select2' );
@Bicarbona
Bicarbona / bss_to_wordpress.php
Created April 12, 2018 09:39 — forked from bkonia/bss_to_wordpress.php
BSS to WordPress - Automatically Publishes Bootstrap Studio Exports to WordPress
#!/usr/local/bin/php
<?php
/* This script automatically publishes BSS exports to WordPress.
* Install Composer from https://getcomposer.org/ . Composer needs to be installed on your local computer where BSS is installed, NOT on the server.
* Use Composer to install QueryPath (also on your local computer), following the instructions at https://github.com/technosophos/querypath
* On the server, install the JSON Basic Authentication WordPress plugin from https://github.com/WP-API/Basic-Auth
* Create an ini file in the bss_exports parent directory, containing values for base_url, wp_username, wp_password.
* BSS automatically creates an assets folder in the export directory. This folder contains subfolders for css, images, js, etc... To automatically upload assets, provide ini values for ssh_username, ssh_host, ssh_path (file system path to your public web directory with no trailing slash)
* In BSS, create a meta tag for each page you want to publish.
@Bicarbona
Bicarbona / row-closed-columns.js
Created October 27, 2016 22:50 — forked from cliffordp/row-closed-columns.js
Adds .row-closed to PageLines DMS Canvas Area section so columns within don't have spacing between columns. CHANGE your jQuery selector. Could choose to add .row-squared instead.
<script>
jQuery(document).ready(function() {
//from http://www.pagelinestheme.com/adding-jquery-code-dms-editor/
//CHANGE the jQuery selectors using your Canvas Area's Section ID
jQuery('#pl_areaukh0pxs .pl-area-wrap .editor-row').addClass('row-closed'); //for when using DMS Editor non-preview mode
jQuery('#pl_areaukh0pxs .pl-area-wrap .row.grid-row').addClass('row-closed'); //for when not
})
</script>
@Bicarbona
Bicarbona / DMS-hacks.php
Last active June 27, 2016 15:50
Customize the DMS
<?php
// From http://www.pagelinestheme.com/disable-dms-regions-per-page/
//Disable Fixed, Header, and Footer on all these Page IDs
add_filter( 'pl_setting-region_disable_fixed', 'customize_templates_by_page' );
add_filter( 'pl_setting-region_disable_header', 'customize_templates_by_page' );
add_filter( 'pl_setting-region_disable_footer', 'customize_templates_by_page' );
function customize_templates_by_page() {
//could choose to still show for Admins (e.g. copy content from footer to template)
//if( current_user_can('edit_theme_options') ) { return false; }
@Bicarbona
Bicarbona / 0_reuse_code.js
Created April 19, 2016 21:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Bicarbona
Bicarbona / wp-snip.php
Last active March 30, 2016 22:59
wp snippets
<?php
/**
*
* @ 28.3.2016 - Get Custom Term ID, Term name, Term description ...
*
**/
global $post;
$terms = get_the_terms( $post->ID , 'custom-term-slug' );
@Bicarbona
Bicarbona / acf-wrapper-functions.php
Last active March 27, 2016 21:24 — forked from raideus/acf-wrapper-functions.php
Wrapper functions for Advanced Custom Fields
<?php
/**
* Return a custom field stored by the Advanced Custom Fields plugin
*
* @global $post
* @param str $key The key to look for
* @param mixed $id The post ID (int|str, defaults to $post->ID)
* @param mixed $default Value to return if get_field() returns nothing
* @return mixed
* @uses get_field()
@Bicarbona
Bicarbona / headway-body-class.php
Last active April 19, 2016 21:20
Headway body class
<?php
add_filter( 'body_class', 'hbd_add_to_body' );
function hbd_add_to_body($existing_classes) {
$existing_classes[] = HeadwayOption::get('child-theme-backdrop-color-scheme');
return $existing_classes;
}