Skip to content

Instantly share code, notes, and snippets.

@yablko
yablko / keybindings.json
Last active May 19, 2024 19:07
VS Code nastavenia 2020
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+cmd+b",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "cmd+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
@dcts
dcts / workbench.colorCustomizations.json
Created April 14, 2020 16:51 — forked from jacklorusso/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": "",
@apfelchips
apfelchips / defaults.duti
Last active December 23, 2023 03:53
set file-associations on macOS: ~ 🥖.config 🥖duti 🥖defaults.duti
# duti settings file
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti"
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"'
## duti documentation http://duti.org/documentation.html
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme
# List of MIME Types:
@andrewpetrochenkov
andrewpetrochenkov / lsappinfo.sh
Last active April 22, 2024 12:33
macOS app frontmost
#!/usr/bin/env bash
{ set +x; } 2>/dev/null
lsappinfo info -only name `lsappinfo front` | awk -F'"' '{print $4}'
lsappinfo info -only pid `lsappinfo front` | awk -F'"=' '{print $2}'
lsappinfo info -only bundlepath `lsappinfo front` | awk -F'"' '{print $4}'
lsappinfo info -only bundleID `lsappinfo front` | awk -F'"' '{print $4}'
<?php
/**
* Hook: woocommerce_before_main_content.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
* @hooked WC_Structured_Data::generate_website_data() - 30
*/
@ontiuk
ontiuk / woocommerce-select2-selectwoo-remove
Last active May 17, 2023 13:55
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' );
@XuankangLin
XuankangLin / clipboard.py
Created January 28, 2017 04:20
Read from and Write to clipboards in python scripts, works on Mac at least.
import subprocess
def getClipboardData():
p = subprocess.Popen(['pbpaste'], stdout=subprocess.PIPE)
retcode = p.wait()
data = p.stdout.read()
return data
def setClipboardData(data):
p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE)
<?php
/*
* Note! This is no longer updated here in the Gist. It has been moved to a repo.
*
* @link https://github.com/daggerhart/wp-custom-menu-items
*/
/**
* Class custom_menu_items
@luqmaan
luqmaan / write_to_clipboard.py
Last active April 5, 2023 16:35
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())
<?php
function add_footer_info($content) {
if( is_single() && is_main_query() ) {
$content .= get_template_part('includes/blog', 'author');
}
return $content;
}
add_filter('the_content', 'add_footer_info', 20);