Skip to content

Instantly share code, notes, and snippets.

Avatar

Shinichiro Aska s-aska

View GitHub Profile
@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 Aug 25, 2020
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 ]
View RoundedTransformation.java
package info.justaway.display;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
View micro-autopager.js
(function (ns) {
'use strict';
var autopager = function (callbackOnce) {
setTimeout(function () {
if (autopager.bottom()) {
callbackOnce.call();
} else {
autopager(callbackOnce);
View micro-autopager-jq.js
(function (ns, w, d, $) {
'use strict';
var win = $(w);
var doc = $(d);
var autopager = function () {
setTimeout(function () {
if ((doc.height() - (win.scrollTop() + win.height())) < win.height()) {
@s-aska
s-aska / git-merge.sh
Last active Aug 29, 2015
簡易に git merge する奴
View git-merge.sh
#!/bin/bash
# Usage: git-merge.sh [branch]
# ex: git-merge.sh master
set -ue
# set -e ... 途中でエラーが発生したら止める
# set -u ... 未定義の変数を参照したらエラー
if [[ $# == 0 ]];
View JFITransparent.h
#import <UIKit/UIKit.h>
@interface JFITransparent : UIView
@end
@s-aska
s-aska / Aska.css
Last active Aug 29, 2015
LimeChat Theme
View Aska.css
html {
font-family: "Menlo";
background-color: #272822;
color: white;
word-wrap: break-word;
margin: 0;
padding: 3px 4px 10px 4px;
font-size: 12px;
}
@s-aska
s-aska / version-check.rb
Last active Aug 29, 2015
maven version check
View version-check.rb
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
def compile(library)
package, name, version = library.split(':')
filepath = package.gsub(/\./, '/') + '/' + name
url = "http://search.maven.org/remotecontent?filepath=#{filepath}/maven-metadata.xml"
res = Net::HTTP.get URI.parse(url)
@s-aska
s-aska / 0_reuse_code.js
Created May 8, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.