This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GoogleChrome.swift | |
// Justaway | |
// | |
// Created by Shinichiro Aska on 5/18/15. | |
// Copyright (c) 2015 Shinichiro Aska. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# exit if a command fails | |
set -e | |
echo "" | |
echo "-----------------------" | |
echo "Installing dependencies" | |
echo "-----------------------" | |
# Homebrew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MasterSpark::Web::Dispatcher; | |
use strict; | |
use warnings; | |
use Amon2::Web::Dispatcher::RouterSimple; | |
connect '/{action}' => { controller => 'Root' }; | |
connect '/{controller}/{action}' => {}, { | |
on_match => sub { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Hamburger::Model; | |
use parent 'Teng'; | |
use DateTime; | |
sub dbh { | |
my $self = shift; | |
$self->SUPER::dbh; | |
$self->connect unless $self->{dbh}; | |
$self->{dbh}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"; |