This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
playerurl=http://radiko.jp/player/swf/player_3.0.0.01.swf | |
playerfile=./player.swf | |
keyfile=./authkey.png | |
if [ $# -eq 1 ]; then | |
channel=$1 | |
output=./$1.flv | |
runtime=10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ScalableImageView = function(params) { | |
var self = Ti.UI.createImageView(params); | |
if (params.scaleType != 'aspectFit') { | |
self.addEventListener('load', function(e) { | |
var image = self.toBlob(); | |
var selfBlob = self.toImage(); | |
if (params.scaleType == 'aspectFill') { | |
var imageWidth = image.width; | |
var imageHeight = image.height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void addValue(String val, String key, OutputStream strm, String boundary) throws UnsupportedEncodingException, IOException { | |
strm.write(boundary.getBytes("UTF-8")); | |
strm.write("\r\n".getBytes("UTF-8")); | |
strm.write("Content-Disposition: form-data; name=\"".getBytes("UTF-8")); | |
strm.write(key.getBytes("UTF-8")); | |
strm.write("\"\r\n\r\n".getBytes("UTF-8")); | |
strm.write(val.getBytes("UTF-8")); | |
strm.write("\r\n".getBytes("UTF-8")); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSData+GIF.h" | |
@implementation NSData(GIF) | |
- (BOOL) isGIF { | |
char *bytes = (char *)[self bytes]; | |
return [self length] >= 6 && (strncmp(bytes, "GIF87a", 6) == 0 || strncmp(bytes, "GIF89a", 6) == 0); | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// EndlessSummer.c | |
// Tumbltail | |
// | |
// Created by nya on 2013/11/05. | |
// | |
// | |
#import "EndlessSummer.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void) requestPhotoPermission:(void(^)(BOOL))block { | |
ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; | |
ALAuthorizationStatus authStatus = [ALAssetsLibrary authorizationStatus]; | |
if (authStatus == ALAuthorizationStatusAuthorized) { | |
block(YES); | |
} else if (authStatus == ALAuthorizationStatusDenied || authStatus == ALAuthorizationStatusRestricted) { | |
block(NO); | |
} else if (authStatus == ALAuthorizationStatusNotDetermined) { | |
[assetsLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) { | |
// Catch the final iteration, ignore the rest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension String { | |
func baseUnitValue(letters: String) -> Int? { | |
let base = countElements(letters) | |
func getNum(s: String) -> Int? { | |
if let idx = letters.rangeOfString(s) { | |
return distance(letters.startIndex, idx.startIndex) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PopoverActionViewController.swift | |
// ORE2 | |
// | |
// Created by nya on 2/2/16. | |
// Copyright © 2016 cathand.org. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Preferences implements SharedPreferences { | |
File file; | |
JSONObject json; | |
Set<OnSharedPreferenceChangeListener> listeners = new HashSet<>(); | |
public Preferences(File file) { | |
this.file = file; | |
json = loadJson(); | |
} |
OlderNewer