Skip to content

Instantly share code, notes, and snippets.

View dealforest's full-sized avatar

Toshihiro Morimoto dealforest

View GitHub Profile
@kishikawakatsumi
kishikawakatsumi / main.m
Created January 14, 2014 18:52
One-line fix for UITextView on iOS 7
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"UIDisableLegacyTextView"];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
@cutmail
cutmail / gist:ce4f359c34dc7d90ed12
Last active August 29, 2015 14:00
Macのターミナルで桜が降る
ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S="\xf0\x9f\x8c\xb8";a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.01}'
@akisute
akisute / UILabel+AKiOS6Compatibility.m
Created October 2, 2014 08:24
You will no longer be suffered by iOS 6 Hiragino fonts.
- (NSString *)text6Compatible
{
return self.text;
}
- (void)setText6Compatible:(NSString *)text6Compatible
{
self.text = text6Compatible;
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(7)) {
@hirohitokato
hirohitokato / HKLCMTimeUtils.swift
Last active December 1, 2023 14:05
Convenience Methods/Variables/Operators for CMTime
//
// HKLCMTimeUtils.swift
//
// Created by Hirohito Kato on 2015/01/07.
// Copyright © 2020 Kato Hirohito. Licensed under Unlicense(https://unlicense.org). Feel free to use it!
import CoreMedia
// MARK: Initialization
public extension CMTime {
@cabeca
cabeca / simulator_populator_xcode7
Last active April 16, 2020 09:18
This script removes and recreates all simulators in Xcode 7.
#!/usr/bin/env ruby
require 'JSON'
device_types = JSON.parse `xcrun simctl list -j devicetypes`
runtimes = JSON.parse `xcrun simctl list -j runtimes`
devices = JSON.parse `xcrun simctl list -j devices`
devices['devices'].each do |runtime, runtime_devices|
runtime_devices.each do |device|