Skip to content

Instantly share code, notes, and snippets.

View haraki's full-sized avatar

Masashi Haraki haraki

View GitHub Profile
#!/usr/bin/perl
#
# Tokyo Metro Open Data API test code
#
# author : Masashi Haraki
#
use strict;
use warnings;
@haraki
haraki / AndroidManifest.xml
Created September 19, 2015 02:30
Samples using the javamail-android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mharaki.javamail_sample" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@haraki
haraki / AsyncSlack.java
Created September 30, 2015 20:57
In Android, sample to send a message to Slack.(using "okhttp")
package com.example.mharaki.slack;
import android.os.AsyncTask;
import android.util.Log;
import com.squareup.okhttp.FormEncodingBuilder;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
@haraki
haraki / imageviewer.cpp
Last active April 23, 2018 01:47
ItemWidget
ImageViewer::ItemWidget::ItemWidget(QByteArray& buffer) :
m_buffer(Q_NULLPTR),
m_movie(Q_NULLPTR)
{
qDebug() << "ImageViewer::ItemWidget::ItemWidget()";
m_buffer = new QBuffer(&buffer);
Q_ASSERT(m_buffer);
m_movie = new QMovie(m_buffer);
#include <QSortFilterProxyModel>
#include <QDir>
class QFileSystemModel;
class QFileIconProvider;
class FolderModel : public QSortFilterProxyModel
{
public:
explicit FolderModel(QObject *parent = Q_NULLPTR);
QString FolderModel::filePath(const QModelIndex &index) const
{
return fsModel_->filePath(mapToSource(index));
}
QModelIndex FolderModel::setRootPath(const QString &path)
{
return mapFromSource(fsModel_->setRootPath(path));
}
bool FolderModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
{
QFileInfo l_info = fsModel_->fileInfo(source_left);
QFileInfo r_info = fsModel_->fileInfo(source_right);
bool ascOrder = (sortOrder_ == Qt::AscendingOrder);
if(dotFirst_)
{
if(l_info.fileName() == ".")
{
@haraki
haraki / karabiner.json
Created March 16, 2019 02:52
JISキーボードの全角/半角キーをIMEのON/OFF切り替えキーに変換する Karabiner-Elements の設定
{
"description": "JISキーボードの全角/半角キーをIMEのON/OFF切り替えキーに変換。",
"manipulators": [{
"conditions": [{
"input_sources": [{
"language": "en"
}],
"type": "input_source_if"
}],
"from": {
@haraki
haraki / build-mkspecs-linux-rpi-g++.sh
Created April 29, 2019 06:36
Configure the Qt 5.12.3 build for Raspberry Pi 3 B+
PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig \
../qt-everywhere-src-5.12.3/configure \
-platform linux-rpi3-g++ \
-v \
-opengl es2 -eglfs \
-no-gtk \
-opensource -confirm-license -release \
-reduce-exports \
-force-pkg-config \
-nomake examples -no-compile-examples \
@haraki
haraki / .gitattributes
Created May 9, 2019 10:14
initial commit of GitHub for Unity
* text=auto
# Unity files
*.meta -text merge=unityyamlmerge diff
*.unity -text merge=unityyamlmerge diff
*.asset -text merge=unityyamlmerge diff
*.prefab -text merge=unityyamlmerge diff
*.mat -text merge=unityyamlmerge diff
*.anim -text merge=unityyamlmerge diff
*.controller -text merge=unityyamlmerge diff