Skip to content

Instantly share code, notes, and snippets.

<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<polymer-element name="my-element">
<template>
@theblang
theblang / gist:d5bf6d1862dd6678fce1
Created November 17, 2014 16:03
SupportMapFragment loads slowly the first time
private SupportMapFragment supportMapFragment;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_map, container, false);
supportMapFragment = SupportMapFragment.newInstance();
getChildFragmentManager().beginTransaction().replace(R.id.map_container, supportMapFragment).commit();
return view;
@theblang
theblang / grunt-bower sails.js
Created November 18, 2014 05:39
grunt-bower config for sails.js
module.exports = function(grunt) {
grunt.config.set('bower', {
dev: {
dest: '.tmp/public',
js_dest: '.tmp/public/js',
css_dest: '.tmp/public/styles'
}
});
grunt.loadNpmTasks('grunt-bower');
@theblang
theblang / gist:298fc6570354fb249c1c
Created November 19, 2014 00:30
change SailsJS public folder
module.exports.paths = {
public: __dirname + '../public'
};
@theblang
theblang / Support Preference Fragment
Created December 10, 2014 14:17
A sample usage of a Support Preference Fragment from Machinarius
package edu.msstate.nsparc.mdes.fragments;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
@theblang
theblang / README.md
Last active August 29, 2015 14:12 — forked from denji/README.md
@theblang
theblang / gist:0de563b1201014e4d5b6
Created January 12, 2015 04:10
turn off Grunt in .sailsrc
{
"generators": {
"modules": {}
},
"hooks": {
"grunt": false
}
}
@theblang
theblang / gist:48d2d54f671d5996aec5
Created February 13, 2015 16:06
toast on app start
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Toast.makeText(getApplicationContext(), "Hello World", Toast.LENGTH_SHORT).show();
}
}
then in manifest
@theblang
theblang / gist:5f3ceb8214c2e90c948f
Created July 28, 2015 20:24
Decode JWT in Java without the secret using JJWT
String token = Jwts.builder()
.setExpiration(new Date())
.setSubject("Joe")
.signWith(SignatureAlgorithm.HS512, MacProvider.generateKey())
.compact();
System.out.println(token);
String[] pieces = token.split("\\.");
{
"address_components": [
{
"long_name": "College Station",
"short_name": "College Station",
"types": [
"locality",
"political"
]
},