Skip to content

Instantly share code, notes, and snippets.

View 2no's full-sized avatar
🤗

Kazunori Ninomiya 2no

🤗
View GitHub Profile
@2no
2no / AlertManager.swift
Created May 31, 2020 13:18
SwiftUI+Alert Queue
import Combine
import SwiftUI
class AlertManager: ObservableObject {
@Published var isPresented = false
private var queues: [Alert] = []
private var cancellable: AnyCancellable?
init() {
@2no
2no / youtube_proxy.php
Created July 18, 2011 11:55
Flash などから Youtube の動画を読み込む為のプロキシ。後は crossdomain.xml を設置
<?php
// usage:
// youtube_proxy.php?url=http%3a%2f%2fwww%2eyoutube%2ecom%2fwatch%3fv%3dmxPXPv3oNY4%26feature%3dfvsr
define('YOUTUBE_DOMAIN', 'www.youtube.com');
// fmt(優先度:左->右)
$fmtTbl = array(5, 18, 34, 22, 37);
$url = isset($_GET['url']) ? rawurldecode($_GET['url']) : '';
@2no
2no / SwiftyBeaverLogHandler.swift
Last active September 24, 2020 15:10
swift-log+SwiftyBeaver
import Logging
import SwiftyBeaver
struct SwiftyBeaverLogHandler: LogHandler {
var metadata: Logger.Metadata = .init()
var logLevel: Logger.Level = .info
init(_: String) {
}
@2no
2no / extract_app_retentions.js
Last active April 24, 2017 05:33
iTunes Connect App アナリティクスのリテンションを API 経由で取得。Chrome のコンソールで実行
{
const RETENTION_ENDPOINT = '/analytics/api/v1/data/retention';
const DAY_MILLISECONDS = 60 * 60 * 24 * 1000;
const START_DATE = '2016-04-23';
const params = (() => {
const params = {};
(location.hash.split('?')[1] || '').split('&').forEach((param) => {
const parts = param.split('=');
params[parts[0]] = parts[1];
@2no
2no / app.js
Created March 19, 2012 14:37
LINE Unofficial API test
var LINE = require('./line.js');
var line = new LINE();
var email = 'your email';
var password = 'your password';
line.login(email, password, function(error, result) {
if (error) {
return;
}
@2no
2no / inside-frontend-vol1.md
Last active February 27, 2017 04:42
Inside Frontend Vol.1

Inside Frontend Vol.1

Web over ServiceWorker

@jxck

Web vs PC App

これまで

Web vs Mobile

@2no
2no / packages.config
Last active February 13, 2017 04:16
$ cinst packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="1password" />
<package id="7zip" />
<package id="ag" />
<package id="adobe-creative-cloud" />
<package id="atom" />
<package id="autohotkey" />
<package id="chefdk" />
<package id="chocolateygui" />
@2no
2no / AutoHotkey.ahk
Last active January 17, 2017 04:15
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode,2
#InstallKeybdHook
#UseHook
#Space::IME_SET(!IME_GET())
#Enter:: return ; Disable Windows Narrator
@2no
2no / git2go_log.go
Last active December 11, 2016 12:08
git2go で `git log`
package main
import (
"fmt"
"log"
"os"
"strings"
"github.com/libgit2/git2go"
)