Skip to content

Instantly share code, notes, and snippets.

View takeshiyako2's full-sized avatar

Takeshi Yako takeshiyako2

View GitHub Profile
@takeshiyako2
takeshiyako2 / MainActivity.java
Last active February 1, 2017 05:58
Android List AutoScroll Sample
package app.sample.listautoscroll;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
@takeshiyako2
takeshiyako2 / AndroidManifest.xml
Last active February 1, 2017 05:54
Android AdMob
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.admob.com.admobempty">
<!-- Include required permissions for Google Mobile Ads to run-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
@takeshiyako2
takeshiyako2 / renew_ip_address_test.xml
Created August 25, 2016 06:42
Change Route53 IP address by dnscurl.pl
<?xml version="1.0" encoding="UTF-8"?>
<ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
<ChangeBatch>
<Changes>
<Change>
<Action>DELETE</Action>
<ResourceRecordSet>
<Name>test.hitokoto.co.</Name>
<Type>A</Type>
<TTL>300</TTL>
@takeshiyako2
takeshiyako2 / td-agent.conf
Created July 27, 2016 06:14
fluent-plugin-google-cloud-storage-out config sample
# tail
<source>
type tail
format /^(?<date>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) (?<status>\S+) \[(?<role>\S+)\] (?<info>.*)$/
path /tmp/application.log
pos_file /var/log/td-agent/myapp.application.pos
tag td.myapp.application
</source>
<match td.myapp.application>
@takeshiyako2
takeshiyako2 / 017_historia.conf
Last active January 20, 2016 05:40
nginx ssl settings sample for A++
server {
listen 443;
server_name historia.hitokoto.co;
root /var/www/historia;
index index.php;
charset utf-8;
gzip on;
gzip_types text/css text/javascript application/json;
ssl on;
@takeshiyako2
takeshiyako2 / eccube.conf
Created January 14, 2016 05:47
EC-CUBE3 nginx config
server {
listen 80;
root /var/www/eccube/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 500 502 503 504 /50x.html;
@takeshiyako2
takeshiyako2 / get_go.php
Last active November 13, 2015 07:57
PHP with Go lang bbpd
<?php
$url = "http://localhost:12333/GetItemJSON";
$postdata = "{\"Key\": {\"Id\": {\"S\": \"my_user_id1\"}}, \"TableName\": \"ProductCatalog\"}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
@takeshiyako2
takeshiyako2 / get.go
Last active November 11, 2015 07:58
GoDynamo sample of simple put/get
package main
import (
"fmt"
"github.com/smugmug/godynamo/conf"
"github.com/smugmug/godynamo/conf_file"
get "github.com/smugmug/godynamo/endpoints/get_item"
"github.com/smugmug/godynamo/types/attributevalue"
"net/http"
)
@takeshiyako2
takeshiyako2 / AndroidManifest.xml
Created July 31, 2015 05:04
Android Sample Glide
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.page.facebook.glidetest" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@takeshiyako2
takeshiyako2 / MainActivity.java
Created July 30, 2015 04:27
Android Sample Flick Input Event
package flick.input.test;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.widget.TextView;