Skip to content

Instantly share code, notes, and snippets.

View cyc115's full-sized avatar

Mike Chen cyc115

  • Chicago, IL
  • 05:21 (UTC -12:00)
View GitHub Profile
@cyc115
cyc115 / simple card view.java
Created May 16, 2014 15:01
simple card view
/**
* import com.google.android.glass.app.Card;
* extends Activity
*
**/
/**
* simple card view example
*/
protected void onCreate(Bundle savedInstanceState){
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.content.browser;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@cyc115
cyc115 / async.java
Created May 22, 2014 15:48
async task in android
/**
* The three types used by an asynchronous task are the following:
Params, the type of the parameters sent to the task upon execution.
Progress, the type of the progress units published during the background computation.
Result, the type of the result of the background computation.
Not all types are always used by an asynchronous task. To mark a type as unused, simply use the type Void:
private class MyTask extends AsyncTask<Void, Void, Void> { ... }
@cyc115
cyc115 / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
@cyc115
cyc115 / FingerPrint.cs
Created April 5, 2015 21:15
Generates a 16 byte Unique Identification code of a computer. Example: 4876-8DB5-EE85-69D3-FE52-8CF7-395D-2EA9
using System;
using System.Management;
using System.Security.Cryptography;
using System.Security;
using System.Collections;
using System.Text;
namespace Security
{
/// <summary>
/// Generates a 16 byte Unique Identification code of a computer
@cyc115
cyc115 / privateVariable.js
Created May 1, 2015 20:25
js private memeber variable
//javascript private variable
var counterCreater = function() {
// constructor
function Counter () {
var count = 0 ; // private
this.inc = function () {
count++;
console.log("inc:" + count);
}
this.get = function(){
@cyc115
cyc115 / clone.js
Created May 1, 2015 20:47
javascript clone
//clone
var clone = function (old) {
var my = {}, key ;
for (key in old){
my[key] = old[key];
}
return my ;
}
@cyc115
cyc115 / MainActivity.java
Last active August 29, 2015 14:24 — forked from libinbensin/MainActivity.java
pop up window on Android
public class MainActivity extends
private PopupWindow popWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@cyc115
cyc115 / shortenerKiller.py
Created April 16, 2016 03:02
see what people are posting to goo.gl the url shortener service
import random
import string
import urllib.request
import time
class UrlGen :
def __init__(self, max = 1000, prefix = "" , charLen = 6):
self.max = max
self.current = 0
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjeWNtb3RvIiwiaWF0IjoxNDk2NzY2OTM5LCJleHAiOjE1MjgzMDI5MzUsImF1ZCI6IiIsInN1YiI6IiIsImp0aSI6ImZNYUpKd0h2VlBhVnN0SDdnUGU0In0.MQoVc45jLFxxnM8xeXUwc_bpMuNX6eidw2iJshlkXWY",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjeWNtb3RvIiwiaWF0IjoxNDk2NzY2OTM5LCJleHAiOjE1MjgzMDI5MzUsImF1ZCI6IiIsInN1YiI6IiIsImp0aSI6ImZNYUpKd0h2VlBhVnN0SDdnUGU0In0.MQoVc45jLFxxnM8xeXUwc_bpMuNX6eidw2iJshlkXWY",
"issued_at": "2017-06-06T16:34:56.875816886Z"
}