Skip to content

Instantly share code, notes, and snippets.

@bigdragon1977
bigdragon1977 / Android Privacy Policy Template
Created February 17, 2017 12:43 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@bigdragon1977
bigdragon1977 / session_token_strategy.scala
Created January 5, 2017 12:18 — forked from casualjim/session_token_strategy.scala
Session token strategy example for scalatra auth (scentry)
package org.example
package auth
import org.scalatra.auth.ScentryStrategy
import org.scalatra.{CookieSupport, ScalatraBase}
trait RedisClient {
def get(key: String): Option[String]
}
public class FragAccordion extends FragmentActivity {
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
setContentView(R.layout.frag_fragaccordion);
getSupportFragmentManager().beginTransaction()
.add(R.id.menuPlace, new Fragment0()).commit();
}
@bigdragon1977
bigdragon1977 / EachDirectoryPath.md
Created May 13, 2016 07:56 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@bigdragon1977
bigdragon1977 / get_timeout.cpp
Created May 11, 2016 13:46
QNetworkReply and QNetworkAccessManager timeout in http request
QTimer timer;
timer.setSingleShot(true);
QEventLoop loop;
connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
timer.start(30000); // 30 secs. timeout
loop.exec();
if(timer.isActive()) {
@bigdragon1977
bigdragon1977 / java-attach-api.java
Created April 17, 2016 15:22 — forked from ChinaXing/java-attach-api.java
attach to JVM use java attach API
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;
import java.util.List;
public class ListVM{
public static void main(String[] args){
List<VirtualMachineDescriptor> vmList = VirtualMachine.list();
for(VirtualMachineDescriptor vm : vmList){
System.out.println("name: " + vm.displayName() + " id :" + vm.id());
try{
@bigdragon1977
bigdragon1977 / DatePickerDialogFragment.java
Created March 26, 2016 06:57 — forked from davidcesarino/DatePickerDialogFragment.java
DatePickerDialogFragment to work around Android Issue 34833 on affected versions (>= JELLY_BEAN && < LOLLIPOP).
/*
* Copyright 2012 David Cesarino de Sousa
*
* 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
@bigdragon1977
bigdragon1977 / leaflet_numbered_markers.css
Created March 25, 2016 16:20 — forked from comp615/leaflet_numbered_markers.css
Numbered Markers in Leaflet (JS Mapping)
.leaflet-div-icon {
background: transparent;
border: none;
}
.leaflet-marker-icon .number{
position: relative;
top: -37px;
font-size: 12px;
width: 25px;
@bigdragon1977
bigdragon1977 / EditableCircleMarker.js
Created March 25, 2016 15:05 — forked from glenrobertson/EditableCircleMarker.js
leaflet editable circle with marker
/*
L.EditableCircleMarker is a marker with a radius
The marker can be moved and the radius can be changed
*/
L.EditableCircleMarker = L.Class.extend({
includes: L.Mixin.Events,
options: {
weight: 1,