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
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;
@takeshiyako2
takeshiyako2 / MainActivity.java
Created July 31, 2015 01:44
Android Sample Open Facebook Page
package facebook.page.test;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
@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 / 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
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 / AndroidManifest.xml
Created December 18, 2015 08:49
Android AdMob Interstitial
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.admob.com.admobinterstitialtest">
<!-- 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 / 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 / default.conf
Last active August 3, 2017 19:55
WordPress + Varnish (Varnish port 80 -> nginx port 8080 -> php-fpm)
# /etc/nginx/conf.d/default.conf
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/wordpress;
index index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;