Skip to content

Instantly share code, notes, and snippets.

View Jayin's full-sized avatar
🏠
Working from home

Jayin Tang Jayin

🏠
Working from home
  • None
  • Guangzhou, China
  • 14:36 (UTC +08:00)
  • X @rover_tang
View GitHub Profile
@Jayin
Jayin / cmds.txt
Last active August 29, 2015 14:21 — forked from wong2/cmds.txt
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@Jayin
Jayin / example.java
Last active August 29, 2015 14:21
【Android】save bitmap to localtion. From http://stackoverflow.com/questions/649154/save-bitmap-to-location
// get bitmap from ImageView
Bitmap bmp = ((BitmapDrawable)image.getDrawable()).getBitmap();
FileOutputStream out = null;
try {
out = new FileOutputStream(filename);
bmp.compress(Bitmap.CompressFormat.PNG, 100, out); // bmp is your Bitmap instance
// PNG is a lossless format, the compression factor (100) is ignored
} catch (Exception e) {
e.printStackTrace();
jQuery(document).ready(function($) {
// $(".gifImg").attr('src', './images/loading.gif');
/**
* Created by Jolam on 2014/11/30.
*/
var ResourceLoader = (function (Config, Util, _, Backbone) {
var ResourceLoader = function (opts) {
this.files = opts.files;
@Jayin
Jayin / input.html
Created April 15, 2015 16:01
HTML5 客户端拍照获取图片/选择图片
<input type="file" capture="camera" accept="image/*" />
@Jayin
Jayin / list2dist.py
Created February 24, 2015 16:05
把2个list合并成1一个dist
list1 = [1,2,3]
list2 = ['baidu','google','bing']
//->{1:'baidu', 2:'google', 3:'bing'}
dict(map(lambda x,y:[x,y], list1,list2))
//or
dict(zip(list1,list2))
@Jayin
Jayin / md-menu.html
Last active August 29, 2015 14:08 — forked from cloudsben/md-menu.html
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
@Jayin
Jayin / ScreenShot.java
Created September 19, 2014 13:08
android应用内截图的代码实现
cavas:
方法一:
View view= getWindow().getDecorView();
Bitmap bmp = Bitmap.createBitmap(480, 800, Bitmap.Config.ARGB_8888);
view.draw(new Canvas(b));
/*
* Copyright (C) 2014 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
@Jayin
Jayin / demo.js
Created July 21, 2014 09:56
Js用图层模仿五星星评价功能的特效代码 From http://www.codefans.net/jscss/code/2952.shtml?jdfwkey=huc8j3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>星级评分</title> <script src="http://www.codefans.net/ajaxjs/jquery1.3.2.js" type="text/javascript"></script> <script> $(function(){ $(".star li").mouseenter(function(){ $(".star li").css("background","#f60"); $(this).css("background","#f60"); $(this).nextAll().css("background","#ccc"); }) }); </script> <style type="text/css"> * {padding:0;margin:0;list-style:none; float:left;} .star li { float: left; height: 20px; width: 20px; background-color: #CCC; margin-right: 4px; } </style> </head> <body> <div>选几星:</div> <ul class="star"> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </body> </html>
@Jayin
Jayin / QustomDialogBuilder.java
Last active August 29, 2015 14:02
Qustom helps you make quick custom dialogs for Android. From https://github.com/danoz73/QustomDialog
package com.qustom.dialog;
import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;