Skip to content

Instantly share code, notes, and snippets.

View psamsotha's full-sized avatar

Paul Samsotha psamsotha

View GitHub Profile
import java.io.InputStream;
import java.net.URI;
import java.util.logging.Logger;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import java.util.function.Supplier;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
import org.glassfish.hk2.api.Factory;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
@psamsotha
psamsotha / AsyncTest.java
Last active August 27, 2018 01:45
A Jersey client test using Jersey Test Framework to show how to make async requests.
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.client.InvocationCallback;
@psamsotha
psamsotha / SwingSOLinks.md
Last active July 25, 2018 17:22
Links to some Stack Overflow questions tagged with Swing (all my answers)
@psamsotha
psamsotha / sed cheatsheet
Created July 21, 2018 22:09 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@psamsotha
psamsotha / Makefile
Created July 21, 2018 07:34 — forked from postmodern/Makefile
A generic Makefile for building/signing/install bash scripts
NAME=project
VERSION=0.0.1
DIRS=etc lib bin sbin share
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.md *.txt
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)
@psamsotha
psamsotha / CompleteTestExample.java
Created May 3, 2018 00:06
Example of complete JerseyTest
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.Test;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import static org.assertj.core.api.Assertions.assertThat;
@psamsotha
psamsotha / woocommerce_change_view_cart.php
Created March 26, 2018 20:33
Override function in WooCommerce to change View Cart Text.
<?php
function woocommerce_widget_shopping_cart_button_view_cart() {
echo '<a href="' . esc_url( wc_get_cart_url() ) . '" class="button wc-forward">' . esc_html__( 'View cart', 'woocommerce' ) . '</a>';
}
?>
@psamsotha
psamsotha / disable_woocommerce_shop_links.php
Created March 20, 2018 07:29
Little script to disable shop links in Woocommerce
@psamsotha
psamsotha / purgeAndroid.txt
Created February 11, 2018 21:19 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*