Skip to content

Instantly share code, notes, and snippets.

@smourachov
smourachov / WebSocketClient.java
Created July 4, 2013 23:30
force using TLSv1.2
public static SocketFactory getSSLSocketFactory() throws NoSuchAlgorithmException, KeyManagementException {
return new SocketFactory() {
Socket getSoscket() {
try {
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, sTrustManagers, null);
SSLSocketFactory f = context.getSocketFactory();
Socket res = f.createSocket();
@cobyism
cobyism / gh-pages-deploy.md
Last active June 12, 2024 20:14
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@benjchristensen
benjchristensen / JavadocFilter.java
Created November 30, 2011 20:29
Doclet for filtering public classes from Javadoc
import java.lang.reflect.Array;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.List;
import com.sun.javadoc.Doc;
import com.sun.javadoc.DocErrorReporter;