Skip to content

Instantly share code, notes, and snippets.

View vinamelody's full-sized avatar

Vina Melody vinamelody

View GitHub Profile
@vzsg
vzsg / 1_DispatchBox.swift
Last active October 1, 2019 13:42
Fetching remote configuration on app boot (Vapor 3)
import Dispatch
// Utility class for thread-safe access to an "app global" variable
final class DispatchBox<T>: Service {
private let queue = DispatchQueue(label: "DispatchBox_\(T.self)_Queue")
private var _value: T?
var value: T? {
get { return queue.sync { self._value }}
set { queue.async { self._value = newValue }}
@rosswd
rosswd / multi-git-win.md
Last active February 28, 2024 09:46
Setting up a Github and Bitbucket account on the same computer on Mac OS. Now with a guide for Windows 10.

Setting up github and bitbucket on the same computer (Windows)

Guide for Windows

mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.

Github will be the main account and bitbucket the secondary.

Git for Windows

  • Download and install Git for Windows
    • In the installer, select everything but decide if you want a desktop icon (2nd step)
@mikejolley
mikejolley / gist:3709371
Created September 12, 2012 19:41
Remove WooCommerce Generator Tag
function my_woocommerce_loaded_function() {
global $woocommerce;
// remove WC generator tag from <head>
remove_action( 'wp_head', array( $woocommerce, 'generator' ) );
}
// called only after woocommerce has finished loading
add_action( 'woocommerce_init', 'my_woocommerce_loaded_function' );
@mikejolley
mikejolley / gist:2328155
Created April 7, 2012 11:57
WooCommerce - Custom order number (in 1.5.3+)
add_filter( 'woocommerce_order_number', 'custom_woocommerce_order_number', 1, 2 );
function custom_woocommerce_order_number( $oldnumber, $order ) {
return 'CUSTOMPREFIX' . $order->id;
}