Skip to content

Instantly share code, notes, and snippets.

View k-yamada's full-sized avatar

Kazuhiro Yamada k-yamada

  • japan
View GitHub Profile
package com.netgem.diamondcore.base.manager
import android.annotation.TargetApi
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
@swalkinshaw
swalkinshaw / tutorial.md
Last active June 6, 2025 19:24
Designing a GraphQL API
@phillippbertram
phillippbertram / RxCaptureMetadataOutputObjectsDelegateProxy.swift
Created January 16, 2018 10:39
RxSwift DelegateProxy for AVCaptureMetadataOutputObjectsDelegate
import AVFoundation
import RxSwift
import RxCocoa
extension Reactive where Base: AVCaptureMetadataOutput {
/// Reactive wrapper for `delegate`.
///
/// For more information take a look at `DelegateProxyType` protocol documentation.
public var delegate: DelegateProxy<AVCaptureMetadataOutput, AVCaptureMetadataOutputObjectsDelegate> {
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 3, 2025 20:55
Swift Concurrency Manifesto
@oc2pcoj
oc2pcoj / Good IOS RTSP Player.md
Last active April 19, 2025 15:00
iOS RTSP player for IP video cameras
@yutelin
yutelin / String+AES.swift
Last active January 22, 2024 12:36
String+AES.swift
import Foundation
import CryptoSwift
extension String {
func aesEncrypt(key: String, iv: String) throws -> String{
let data = self.dataUsingEncoding(NSUTF8StringEncoding)
let enc = try AES(key: key, iv: iv, blockMode:.CBC).encrypt(data!.arrayOfBytes(), padding: PKCS7())
let encData = NSData(bytes: enc, length: Int(enc.count))
let base64String: String = encData.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0));
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active July 4, 2024 05:29
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@rummelonp
rummelonp / Capfile
Created January 22, 2015 11:22
capistrano 3 でサブディレクトリをデプロイするやつ
require 'capistrano/git'
class Capistrano::Git
module SubDirectoryStrategy
include DefaultStrategy
def release
git :archive, fetch(:branch), fetch(:project_root), '| tar -x -C', release_path, "--strip=#{fetch(:project_root).count('/')+1}"
end
end
@mattt
mattt / NSDecimalNumber.swift
Last active April 1, 2023 00:06
NSDecimalNumber Additions for Swift
import Foundation
// MARK: - Comparable
extension NSDecimalNumber: Comparable {}
public func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool {
return lhs.compare(rhs) == .OrderedSame
}
@sumio
sumio / gist:8c08f751c27e827f3463
Last active July 20, 2016 16:11
uiautomatorのテストをgradleやAndroid Studioからビルド・実行するためのbuild.gradleファイルです。
/*
* Copyright 2014-2015 TOYAMA Sumio <[email protected]>
*
* 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