Skip to content

Instantly share code, notes, and snippets.

View ULei's full-sized avatar

藍月 ULei

View GitHub Profile
@ULei
ULei / KeyStoreHelper.java
Created March 19, 2018 02:54 — forked from alphamu/KeyStoreHelper.java
Using Android KeyStore to generate a password. The code create a public/private key pair and uses the base64 encoded form of the certificate to as the password. The code modified the KeystoreHelper class from AOSP demo projects.
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ULei
ULei / CanActivate.dart
Created May 11, 2017 05:48 — forked from kulshekhar/CanActivate.dart
AngularDart sample using CanActivate
import 'dart:html';
import 'package:angular2/core.dart';
import 'package:angular2/router.dart';
@Component(
selector: 'my-app',
styleUrls: const ['app_component.css'],
template: '''
<h1>My First Angular 2 App</h1>
@ULei
ULei / main.dart
Created March 7, 2017 03:37 — forked from anonymous/main.dart
blue-kiwi-7681
import 'dart:async';
void main() {
_test();
}
_test() async {
print("start");
await sleep1();
await sleep2();
@ULei
ULei / gist:f9282e42457d6c812c2191bef0dc5154
Created August 16, 2016 03:44 — forked from timdream/gist:5968469
Github 發 Pull Request & 貢獻流程速查

Github 發 Pull Request & 貢獻流程速查

前言

此文目標讀者需先自行學會

  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository
@ULei
ULei / gist:5c007c3140198b863d85fe22ba88e4e8
Created May 25, 2016 10:54 — forked from InfoSec812/gist:a45eb3b7ba9d4b2a9b94
SSL Config Example For Vert.x 3.0.0
package com.zanclus.socialshell;
import com.zanclus.socialshell.utils.AbstractLoggingVerticle;
import static io.vertx.ext.auth.shiro.LDAPAuthRealmConstants.*;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Verticle;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.json.JsonObject;
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
// in JavaScript
com = { acme: {} };
com.acme.Foo = function() {
this.x = 40;
this.y = 2;
};
com.acme.Foo.prototype.sum = function() { return this.x + this.y; };
// in Java
package com.acme;
@ULei
ULei / OkHttpStack.java
Created October 19, 2015 08:13 — forked from bryanstern/OkHttpStack.java
An OkHttp backed HttpStack for Volley
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@ULei
ULei / Readme.md
Last active August 29, 2015 14:06 — forked from gabrielemariotti/Readme.md

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Example:

        //Your RecyclerView