Skip to content

Instantly share code, notes, and snippets.

KAMEDAkyosuke KAMEDAkyosuke

Block or report user

Report or block KAMEDAkyosuke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simple_server
#!/usr/bin/env python3
from http.server import BaseHTTPRequestHandler, HTTPServer
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
print("headers : \n", self.headers)
self.send_response(200)
self.end_headers()
View gist:a447d30f44d8150c747f7f666078551b
NSMutableArray<id> *items = [NSMutableArray array];
NSURL *url = [NSURL URLWithString:@"https://www.google.co.jp"];
NSString *text = @"hello world";
[items addObject:url];
[items addObject:text];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:items
applicationActivities:nil];
// select copy action
[self presentViewController:activityViewController
View gist:c2fa1fbba7d336f80a863f97f124efc2
$ find . -type f -exec grep -nH -e NS_DEPRECATED_IOS\(.*,\ 10_2 {} +
./AVFoundation.framework/Headers/AVCaptureDevice.h:481:AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInDuoCamera NS_DEPRECATED_IOS(10_0, 10_2, "Use AVCaptureDeviceTypeBuiltInDualCamera instead") __TVOS_PROHIBITED;
View gist:350f296f23110690f64b1b5500782d3f
NS_DEPRECATED_IOS
API_DEPRECATED_WITH_REPLACEMENT
WK_DEPRECATED_WATCHOS
NS_CLASS_DEPRECATED_IOS
NS_ENUM_DEPRECATED_IOS
API_DEPRECATED
__OSX_AVAILABLE_BUT_DEPRECATED
NS_DEPRECATED
__OSX_DEPRECATED
DEPRECATED_IN_MAC_OS_X
View implement-tcp-server-in-emacs.el
;; -*- coding:utf-8; mode:emacs-lisp; lexical-binding: t -*-
(require 'cl)
(defconst ragnarok-process "ragnarok-process")
(defvar ragnarok-service-port 1743)
(defun ragnarok-process-filter (process string)
"外部プロセスからのデータ取得"
(message "%s : %s" (process-name process) string))
@KAMEDAkyosuke
KAMEDAkyosuke / find-grep NS_AVAILABLE_IOS(10_3.sh
Last active Mar 29, 2017
find . -type f -exec grep -B 10 -nH -e ios\(10.3 {} +
View find-grep NS_AVAILABLE_IOS(10_3.sh
$ find . -type f -exec grep -B 10 -nH -e NS_AVAILABLE_IOS\(10_3 {} +
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-577-AVF_EXPORT NSString *const AVAudioSessionInterruptionOptionKey NS_AVAILABLE_IOS(6_0);
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-578-
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-579- /* Only present in begin interruption events, where the interruption is a direct result of the application being suspended
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-580- by the operating sytem. Value is a boolean NSNumber, where a true value indicates that the interruption is the result
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-581- of the application being suspended, rather than being interrupted by another audio session.
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-582-
./AVFoundation.framework/
View gist:f567feb7c628821874b6
package main
import "log"
import "reflect"
func Apply(f interface{}, args []interface{}) interface{}{
fv := reflect.ValueOf(f)
if fv.Kind() != reflect.Func {
log.Fatal("error")
}
@KAMEDAkyosuke
KAMEDAkyosuke / response.json
Last active May 18, 2018
複数画像が含まれた tweet を https://api.twitter.com/1.1/statuses/show.json で取得した際のレスポンス
View response.json
{"created_at":"Sun Feb 22 00:27:31 +0000 2015","id":569292363937349633,"id_str":"569292363937349633","text":"#\u6771\u4eac\u30de\u30e9\u30bd\u30f3 \u304c\u30b9\u30bf\u30fc\u30c8\uff01\n@Tokyo42195_org \u304b\u3089\u5927\u4f1a\u306e\u69d8\u5b50\u304c\u30c4\u30a4\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\nRT @tokyo42195_org: \u8eca\u3044\u3059\u306b\u7d9a\u304d\u3001\u30de\u30e9\u30bd\u30f3\u30fb10km\u3082\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u30d5\u30b8\u30c6\u30ec\u30d3\u7cfb\u5168\u56fd\u30cd\u30c3\u30c8\u3067\u653e\u9001\u4e2d\u3067\u3059\u3002 http:\/\/t.co\/LoEKszyJ2e","source":"\u003ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\" rel=\"nofollow\"\u003eTweetDeck\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1159274324,"id_str":"1159274324","name":"Twitter Sports Japan","screen_name":"TwitterSportsJP","location":"To
View env.txt
COPY_PHASE_STRIP=NO
JAVA_ZIP_FLAGS=-urg
SDK_PRODUCT_BUILD_VERSION=12B411
HEADERMAP_INCLUDES_PROJECT_HEADERS=YES
EXECUTABLES_FOLDER_PATH=cocospadtest.app/Executables
LOCAL_APPS_DIR=/Applications
ENABLE_STRICT_OBJC_MSGSEND=YES
REMOVE_CVS_FROM_RESOURCES=YES
SED=/usr/bin/sed
SYSTEM_DEVELOPER_UTILITIES_DIR=/Applications/Xcode6.x.app/Contents/Developer/Applications/Utilities
@KAMEDAkyosuke
KAMEDAkyosuke / gist:7577678
Last active Dec 28, 2015
AAC のハードウェアエンコーダーをサポートしているかどうかのチェック。
View gist:7577678
- (BOOL)isAACHardwareEncoderAvailable
{
OSStatus status;
UInt32 size;;
UInt32 encoderSpecifier = kAudioFormatMPEG4AAC;
status = AudioFormatGetPropertyInfo(kAudioFormatProperty_Encoders,
sizeof(encoderSpecifier),
&encoderSpecifier,
&size);
check_osstatus(status, @"AudioFormatGetPropertyInfo fail");
You can’t perform that action at this time.