Skip to content

Instantly share code, notes, and snippets.

Shinichiro Aska s-aska

Block or report user

Report or block s-aska

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 SFSafariViewController-memo.md

問題

SFSafariViewController内のShareボタンからShare Extensionを起動するとページタイトルが取得できない。

Safari

SFSafariViewController

@s-aska
s-aska / ogp.js
Created Apr 26, 2016
OGP Fetch API for AWS Lambda
View ogp.js
'use strict';
console.log('Loading function');
const http = require('http');
const https = require('https');
const regexs = [
new RegExp('<meta property=["\']og:title["\'] content=["\']([^>]+)["\']', 'i'),
new RegExp('<meta content=["\']([^>]+)["\'] property=["\']og:title["\']', 'i'),
new RegExp('<title>([^<]*)</title>', 'i'),
];
@s-aska
s-aska / longurl.go
Created Mar 3, 2016
🔫 Don't redirect !!!
View longurl.go
package main
import(
"errors"
"fmt"
"net/http"
)
var RedirectAttemptedError = errors.New("redirect")
var nopasteClient = func() (*http.Client) {
View carthage.sh
#!/bin/bash
# exit if a command fails
set -e
echo ""
echo "-----------------------"
echo "Installing dependencies"
echo "-----------------------"
# Homebrew
View How-to-use-Developer-Tools.md

Developer Toolsの使い方

  1. http://justaway.info/ を Google Chrome で開く
  2. 適当なところを右クリックして「要素の検証」を選択
  3. 「Developer Tools」というウィンドウが立ち上がる、「Console」というタブを選択
  4. 🚫の下の「> 」となっている部分の少し右をクリックし、以下のコードをペーストしEnterキーを叩く(この時画面をよく見ておいて下さい)
$('img').animate({top: '-1000px'})
@s-aska
s-aska / GoogleChrome.swift
Created May 18, 2015
任意のURLをブラウザ(Chrome)で開いた際に遷移元アプリに戻る導線を付ける
View GoogleChrome.swift
//
// GoogleChrome.swift
// Justaway
//
// Created by Shinichiro Aska on 5/18/15.
// Copyright (c) 2015 Shinichiro Aska. All rights reserved.
//
import UIKit
View TwitterVia.swift
import Foundation
import SwifteriOS
struct TwitterVia {
let name: String
let URL: NSURL?
struct Static {
static let regexp = NSRegularExpression(pattern: "<a href=\"(.+)\" rel=\"nofollow\">(.+)</a>", options: NSRegularExpressionOptions(0), error: nil)!
}
@s-aska
s-aska / Notification.swift
Last active Dec 5, 2015
NSNotificationCenterのラッパー
View Notification.swift
import Foundation
class Notification {
// MARK: - Singleton
struct Static {
static let instance = Notification()
static let queue = dispatch_queue_create("Notification.Static.instance.cache", DISPATCH_QUEUE_SERIAL)
}
@s-aska
s-aska / Keychain.swift
Last active Jun 11, 2019
Swift Keychain class ( supported Xcode 6.0.1 )
View Keychain.swift
import UIKit
import Security
class Keychain {
class func save(key: String, data: NSData) -> Bool {
let query = [
kSecClass as String : kSecClassGenericPassword as String,
kSecAttrAccount as String : key,
kSecValueData as String : data ]
You can’t perform that action at this time.