Skip to content

Instantly share code, notes, and snippets.

@theblang
theblang / gist:9f722783b10bbbc62d0aaf01f5dcab5e
Created May 15, 2017 04:01
sha3 Windows10 npm install error
C:\Users\theblang>npm install -g sha3
> sha3@1.2.0 install C:\Users\theblang\AppData\Roaming\npm\node_modules\sha3
> node-gyp rebuild
C:\Users\theblang\AppData\Roaming\npm\node_modules\sha3>if not defined npm_config_node_gyp (node "C:\Users\theblang\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Traceback (most recent call last):
File "C:\Users\theblang\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
sys.exit(gyp.script_main())
{
"address_components": [
{
"long_name": "Starkville",
"short_name": "Starkville",
"types": [
"locality",
"political"
]
},
{
"address_components": [
{
"long_name": "College Station",
"short_name": "College Station",
"types": [
"locality",
"political"
]
},
@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("\\.");
@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:0de563b1201014e4d5b6
Created January 12, 2015 04:10
turn off Grunt in .sailsrc
{
"generators": {
"modules": {}
},
"hooks": {
"grunt": false
}
}
@theblang
theblang / README.md
Last active August 29, 2015 14:12 — forked from denji/README.md
@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 / gist:298fc6570354fb249c1c
Created November 19, 2014 00:30
change SailsJS public folder
module.exports.paths = {
public: __dirname + '../public'
};
@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');