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 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 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 / 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 carthage.sh
#!/bin/bash
# exit if a command fails
set -e
echo ""
echo "-----------------------"
echo "Installing dependencies"
echo "-----------------------"
# Homebrew
@s-aska
s-aska / mail_header_get.pl
Created Nov 16, 2010
Mail Header Fast Get
View mail_header_get.pl
my $header;
my $buf;
my $term = "\n\n";
my $term_buf = '';
open($fh, $path) || die "$path $!";
while (read($fh, $buf, 4096)) {
$buf=~tr/\r//;
my $pos = index($term_buf . $buf, $term);
if ($pos >= 0) {
my $pos2 = $pos - length($term_buf);
@s-aska
s-aska / Dispatcher
Created Dec 8, 2010
よく使うDispatcher
View Dispatcher
package MasterSpark::Web::Dispatcher;
use strict;
use warnings;
use Amon2::Web::Dispatcher::RouterSimple;
connect '/{action}' => { controller => 'Root' };
connect '/{controller}/{action}' => {}, {
on_match => sub {
View simple-app.psgi
use lib qw(lib);
use Plack::Request;
use Plack::Builder;
use Plack::Session::Store::File;
use Plack::Session::State::Cookie;
use String::Urandom;
my $secure = 1; # use SSL
my $httponly = 1; # only HTTP
@s-aska
s-aska / app.psgi
Created Feb 18, 2011
Markdown Reader
View app.psgi
use strict;
use Data::Section::Simple;
use Encode;
use JSON;
use Path::Class;
use Plack::Builder;
use Plack::Request;
use Text::Markdown;
use Text::Xslate;
@s-aska
s-aska / Model.pm
Created Feb 28, 2011
reconnect and datetime auto Model.pm
View Model.pm
package Hamburger::Model;
use parent 'Teng';
use DateTime;
sub dbh {
my $self = shift;
$self->SUPER::dbh;
$self->connect unless $self->{dbh};
$self->{dbh};
View get_tweet_count
#!/usr/bin/env perl
use WebService::Simple;
print WebService::Simple->new(
base_url => 'http://urls.api.twitter.com/1/urls/count.json',
response_parser => 'JSON'
)->get( { url => shift } )->parse_response->{count}, "\n";
You can’t perform that action at this time.