Skip to content

Instantly share code, notes, and snippets.

View KalanaDananjaya's full-sized avatar

Kalana Dananjaya Wijethunga KalanaDananjaya

View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@thomasdarimont
thomasdarimont / App.java
Last active June 14, 2023 21:59
Simple example for configuring Spring Security's RoleHierarchy via YAML in Spring Boot, compatible with Java 7
package demo;
import static java.util.Arrays.asList;
import static org.springframework.security.core.authority.AuthorityUtils.createAuthorityList;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@woogists
woogists / wc-add-modify-states.php
Last active May 18, 2021 02:14
[General Snippets] Add or modify states
/**
* Add or modify States
*/
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['XX'] = array(
'XX1' => 'State 1',
'XX2' => 'State 2'
@zorem
zorem / rename-order-status.php
Last active May 27, 2021 17:10
Renaming WooCommerce Order Status
<?php
add_filter( 'wc_order_statuses', 'wc_renaming_order_status' );
/*
* Rename WooCommerce Order Status
*/
function wc_renaming_order_status( $order_statuses ) {
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;