Skip to content

Instantly share code, notes, and snippets.

Avatar
🎩
Happy Saturday!

Hoyt Summers Pittman secondsun

🎩
Happy Saturday!
View GitHub Profile
View network.html
<!doctype html>
<html>
<head>
<title>Network</title>
<script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
<style type="text/css">
#mynetwork {
width: 1200px;
height: 800px;
View settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository />
<interactiveMode />
<offline />
<pluginGroups />
<servers />
<mirrors />
<proxies />
<profiles>
View GetAnnotations.java
ObjectMapper om = new ObjectMapper();
//Basic construction and json serialization
var rec = new Record(42, "Hello, World!");
System.out.println(rec.toString());
System.out.println(om.writeValueAsString(rec));
//Show Constructor
var recClass = Record.class;
View gist:35db2bda4a05d5fa7d38c8f0234b8e68
private Request<Void> registerDevice(JSONObject data) {
nonNull(data, "data");
return Requester.call(() -> {
data.put("deviceToken", FirebaseInstanceId.getInstance().getToken());
String authHash = getHashedAuth(unifiedPushCredentials.getVariant(),
unifiedPushCredentials.getSecret().toCharArray());
@secondsun
secondsun / Recipe.md
Last active Aug 29, 2015
Roast Recipe
View Recipe.md

Strip Roast

  • A New York Strip Roast
  • Dry Rub (recipe follows)
  • Wet Rub (recipe follows)
  1. Preheat the Oven to 450°F
  2. If you have a baking stone, place it in the oven.
  3. Trim the fat on the roast to about 1/4 to 1/2 inch.
  4. Rub the roast with the dry rub on all sides
  5. Place the roast fat side up and make deep incisions with a knife. Stab all the way to the meat.
View AeroGearAndroid1.4.md

#AeroGear Android 1.4

Today we have pushed to Maven Central our the AeroGear's Android library version 1.4. Major features include 1) The Authorizer framework with OAuth2 support 2) enhanced Request and Response handlers for Pipe's 3) a dedicated Push messaging module 4) updated docs and sample applications and 5) full aar support for Android Studio. See the New Feature Showcase section for more details.

Fetching is as easy as always:

Fetch with Maven

<dependency>
    <groupId>org.jboss.aerogear</groupId>
@secondsun
secondsun / lambdas.java
Created May 14, 2014
Lambda's you so crazy
View lambdas.java
@Override
public Operation operate(final Object token, Environment env) {
final int value = verifyAndEvaluate(token, env);
switch (op) {
case ADD:
return ((nextToken, env2) -> (value + verifyAndEvaluate(nextToken, env2)));
case SUB:
View gist:11016751
### Keybase proof
I hereby claim:
* I am secondsun on github.
* I am secondsun (https://keybase.io/secondsun) on keybase.
* I have a public key whose fingerprint is 1B8A 6FBF AF8A 1DEF 080A 7DC4 DD47 F3B3 EC56 F304
To claim this, I am signing this object:
View SyncRoadmap.md

M1 - Basic revision Control, Data Model, Change Management, Server <->

Client Contract

  • We seem to be in agreement on a basic set of metadata to be kept for each object. [objectId, revision, object].
  • We should have a basic server definition which supports CRUD and keeps our revision numbers in check. This may not be a server product but just a spec that can be implemented by anything at this point.
  • We should have basic client code which keeps up with revisions, can check the server for new revisions, and alert the user if there is a
View ExampleApplication.java
public class MyApplication extends Application {
public Registrar registrar;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Registrar r = new Registrar(PUSH_REGISTRATION_URL);
PushConfig config = new PushConfig(GCM_APP_ID);
config.setMobileVariantId(AG_PUSH_VARIANT_ID);
r.register(getApplicationContext(), config, new Callback<Void>() {