Skip to content

Instantly share code, notes, and snippets.

@wangpeng1
wangpeng1 / DownloadManager.java
Created March 21, 2012 07:30
Downloads.java
/*
* Copyright (C) 2010 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
@wangpeng1
wangpeng1 / gist:4006500
Created November 3, 2012 08:03
NotificationViewController
#import "NotificationViewController.h"
#import "CoreDataManager.h"
#import "NotificationEntity.h"
#import "NotificationViewCell.h"
#import "PeopleDetailViewController.h"
#import "PlaceDetailViewController.h"
@interface NotificationViewController ()
@end
import android.content.Context;
import android.net.Uri;
import com.squareup.okhttp.Cache;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.picasso.Downloader;
import java.io.File;
import java.io.IOException;
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
ackage com.dngames.mobilewebcam;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
//
// TPExtensions.swift
// Example
//
// Created by Le VanNghia on 3/26/15.
// Copyright (c) 2015 Le VanNghia. All rights reserved.
//
import UIKit
@wangpeng1
wangpeng1 / print
Created June 29, 2015 09:39
打印
import Foundation
func printlog(message:String, filePath : String = __FILE__, functionName : String = __FUNCTION__, line : Int = __LINE__){
let fileName = filePath.lastPathComponent
println("\(fileName) \(functionName) [Line \(line)]: \(message)")
}
func printlog(filePath : String = __FILE__, functionName : String = __FUNCTION__, line : Int = __LINE__){
let fileName = filePath.lastPathComponent
@wangpeng1
wangpeng1 / AvcEncoder.java
Last active August 29, 2015 14:26 — forked from wobbals/AvcEncoder.java
MediaCodec encoder sample
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {
using UnityEngine;
using System.Collections;
using System.Security.Cryptography;
using System.Text;
public class EncryptedPlayerPrefs {
// Encrypted PlayerPrefs
// Written by Sven Magnus
// MD5 code by Matthew Wegner (from [url]http://www.unifycommunity.com/wiki/index.php?title=MD5[/url])
@wangpeng1
wangpeng1 / AndroidRankingUtility.cs
Created June 23, 2016 03:20 — forked from kankikuchi/AndroidRankingUtility.cs
プラグインを書かずにGoogle Play Game Servicesのランキングとアチーブメントを実装【Unity】【Android】【アセット】
// AndroidRankingUtility.cs
// http://kan-kikuchi.hatenablog.com/entry/AndroidRankingUtility
//
// Created by kan.kikuchi on 2016.04.01.
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;