Skip to content

Instantly share code, notes, and snippets.

@julianshen
julianshen / gist:4960582
Created February 15, 2013 14:07
qadb.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
@julianshen
julianshen / build.gradle
Created June 15, 2013 15:40
Include native lib in gradle
task copyNativeLibs(type: Copy) {
from fileTree(dir: 'jni', include: '**/*.so' ) into 'build/native-libs'
}
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir file('build/native-libs')
}
<blink android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textClock"
android:textSize="60sp"
android:textColor="#b3b5b5"/>
</blink>
<TextClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textClock"
android:textSize="60sp"
android:textColor="#b3b5b5"
android:format24Hour="k"/>
<blink android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textClock"
android:textSize="60sp"
android:textColor="#b3b5b5"
android:format24Hour="k"/>
<blink android:layout_width="wrap_content"
android:layout_height="wrap_content">
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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
@julianshen
julianshen / activity_main.xml
Last active December 19, 2015 00:29
Attributes of SimpleCellLayout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:celllayout="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.jlnshen.widget.celllayout.SimpleCellLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
@julianshen
julianshen / attrs.xml
Created June 26, 2013 17:08
Attributes of SimpleCellLayout
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="SimpleCellLayout">
<attr name="col" format="integer"/>
<attr name="row" format="integer"/>
<attr name="gapsize" format="dimension"/>
<attr name="colspan" format="integer"/>
<attr name="rowspan" format="integer"/>
<attr name="cellX" format="integer"/>
<attr name="cellY" format="integer"/>
@julianshen
julianshen / SimpleCellLayout.java
Last active December 19, 2015 00:29
init of SimpleCellLayout
public SimpleCellLayout(Context context, AttributeSet attrs) {
super(context, attrs);
initFromAttributes(context, attrs);
}
public SimpleCellLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initFromAttributes(context, attrs);