Skip to content

Instantly share code, notes, and snippets.

View YoshihitoAso's full-sized avatar
🐼

Yoshihito Aso YoshihitoAso

🐼
  • BOOSTRY Co., Ltd.
  • Tokyo
  • X @y_asoh
View GitHub Profile
@YoshihitoAso
YoshihitoAso / gist:9632091
Last active September 16, 2021 04:20
[MongoDB][Python]pythonからmongodbを操作する

PythonからMongoDBを操作する

PyMongoのインストール方法

pythonから利用するためのモジュールとしてPyMongoを利用する。

インストール方法は簡単で、pipであれば以下でOK。

$ pip install pymongo

サンプル

@YoshihitoAso
YoshihitoAso / gist:311b0a1d40174e1bfdae
Last active September 19, 2019 16:28
[Excel]excelシートの書式をすべて削除するマクロ

#Excelシートの書式をすべて削除するマクロ

仕事柄Excelを使うことが多いです。

最近も回ってきた資料を更新していたら、列をコピペして挿入などすると、

「セルの書式が多すぎるため、書式を追加できません」

のエラーが出まくって暫く白目をむいたりした。

@YoshihitoAso
YoshihitoAso / gist:0c48e058e7b0dfa3cf34
Last active January 13, 2019 01:47
[Java][Jad]jadでディレクトリ配下を一括デコード

jadでディレクトリ配下を一括デコード

jad -8 -d src -s .java -r dist **/*.class

でOK。

srcディレクトリ配下にデコードされたソースが格納される。

@YoshihitoAso
YoshihitoAso / gist:9048005
Last active December 18, 2018 05:30
[Python][Mecab]ubuntu環境にmecabをインストールする方法

Ubuntu環境にMecabをインストールする方法

インストール手順

$ sudo apt-get install mecab libmecab-dev mecab-ipadic
$ sudo aptitude install mecab-ipadic-utf8
$ sudo apt-get install python-mecab

SAMPLE

EOS開発環境構築〜コントラクトサンプル実行

0. 前準備

  1. Dockerをインストールする。
  2. ここでは、下記のディレクトリを作成しておく。※構成は自由だが、変える場合は以下の手順を適宜書き換える必要がある。
.
├── build
│   └── hello
├── config ※nodeosのconfigが格納される
@YoshihitoAso
YoshihitoAso / gist:9047977
Created February 17, 2014 10:10
[Ubuntu][PostgreSQL]ubuntuにpostgresqlをインストールする方法

UbuntuにPostgreSQLをインストールする方法

Ubuntuのバージョン情報

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10
DISTRIB_CODENAME=quantal
DISTRIB_DESCRIPTION="Ubuntu 12.10"
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;