Skip to content

Instantly share code, notes, and snippets.

View KatagiriSo's full-sized avatar

KatagiriSo KatagiriSo

View GitHub Profile
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@tmd45
tmd45 / gist:1369167
Created November 16, 2011 03:34
MITライセンス表示文章の雛形(英語+日本語)
The MIT License
Copyright (c) {year} {copyright holders}
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T
@TonnyXu
TonnyXu / RVi.md
Created August 3, 2012 07:49
About RVI(Remote Virtual Interface)

What is RVI?

RVI = Remote Virtual Interface

What RVI can do?

Using RVI, you can capture network packages in iOS using any normal package capturing tools like tcpdump etc.

Wire your rvi to Mac

@setoh2000
setoh2000 / MSOrderdDictionary.h
Created April 10, 2013 18:03
順序を保存するNSMutableDictionary NSMutableDictionaryなどを継承するのが結構大変なのでNSMutableDictionaryとキーを保持するNSMutableArrayを内包したものを自作。 自分が使うメンバーしか実装していない。
#import <Foundation/Foundation.h>
@interface MSOrderdDictionary : NSObject <NSCoding>
{
NSMutableDictionary *dictionary;
NSMutableArray *array;
}
+ (id)dictionary;
@satoshin2071
satoshin2071 / SBCLogUtil.m
Last active August 30, 2017 01:57
[ObjcC] NSLogをコンソールとファイル両方に出力する
#import "SBCLogUtil.h"
#include <pthread.h>
@implementation SBCLogUtil
void SBCLog(NSString *format, ...)
{
// ファイル名用formatter
NSDateFormatter *fileNameFormatter = [[NSDateFormatter alloc]init];
//
// ViewController.m
// AVPlayerCaching
//
// Created by Anurag Mishra on 5/19/14.
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer
//
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
SOLID規則のメモ
S Single responsibility 1クラス1債務
O Open-Closed 
L Liskov substitution
I Interface
Single responsibility principle
class Stream<T> {
var subscribers: [(T) -> Void] = []
func subscribe(subscriber: (T) -> Void) {
subscribers.append(subscriber)
}
func publish(message: T) {
for subscriber in subscribers {
subscriber(message)
@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active July 15, 2024 09:32
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type