Skip to content

Instantly share code, notes, and snippets.

View shinshin86's full-sized avatar
👶

Yuki Shindo shinshin86

👶
View GitHub Profile
@shinshin86
shinshin86 / mongo_data_to_data_frame.py
Created April 13, 2017 22:58
This is sample of mongo data to data frame
import pymongo
import json
import pandas as pd
from bson.json_util import dumps
def get_co():
client = pymongo.MongoClient(hostname, port) # hostname & port
db = client.dbname # db name
collection = db.collection_name # collection name
return collection
@shinshin86
shinshin86 / slack_files_delete.py
Created May 28, 2017 00:29
Script to delete files uploaded to Slack.
# This code is taken from these blog.
# https://www.shiftedup.com/2014/11/13/how-to-bulk-remove-files-from-slack
# http://qiita.com/sotayamashita/items/cb811f512162e61f56f4
#
# And I am changing the implementation a little.
# (It got to get arguments, and modify for Python 3)
import requests
import json
import calendar
@shinshin86
shinshin86 / pocket_exportdata_to_json.py
Last active May 14, 2018 06:37
Pocket export html convert to json
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import collections as cl
import json
"""
The export data is converted into json file of this structure.
///////////////
{
@shinshin86
shinshin86 / vuex-plugin-sample.js
Created January 25, 2018 21:29
vuex plugin sample
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const incrementPlugin = store => {
store.subscribe((mutation, state) => {
if(mutation.type === "showCount") {
state.count++
}
@shinshin86
shinshin86 / stdin-sample.js
Created February 6, 2018 14:19
stdin sample at Node.js
// stdin sample at Node.js
var lines = []
var rl = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})
rl.on('line', ((line) => {
lines.push(line)
@shinshin86
shinshin86 / go_build01.sh
Created February 26, 2018 12:04
Shell script for Go build. Target -> Linux(386, 64), Windows(386, 64), Darwin(386, 64)
#!/bin/sh
# reference : https://gist.github.com/twinbird/9cb8979e163e89ae6a88fd650291fd12
if [ $# != 1 ]; then
echo "Usage: $0 [binary name]"
exit 0
fi
fpath=$1
fname_ext="${fpath##*/}"
@shinshin86
shinshin86 / docker-compose-dev-wordpress.yml
Created October 20, 2018 06:53
Create development environment of wordpress using docker compose.
version: '3.7'
services:
wordpress:
image: wordpress
restart: always
container_name: 'app-conatiner-name'
ports:
- 8080:80
@shinshin86
shinshin86 / OpenGoogleChrome.applescript
Created November 11, 2018 13:34
Open Google Chrome on AppleScript
do shell script "open -a Google\\ Chrome {URL}"
@shinshin86
shinshin86 / install-vim-plug-and-fzf.sh
Last active July 15, 2020 12:30
Install script "vim-plug" and "fzf"
########################################################
# This environment is already install "git" and "vim"
########################################################
# clean & update
apt-get autoclean
apt-get update
# Install curl
apt-get install -y curl
@shinshin86
shinshin86 / clojure-repl-at-docker.sh
Created March 16, 2019 06:59
Start clojure repl sample at docker container.
# if not pulled docker container
# docker pull clojure
docker run -it --rm --name repl-clujure clojure /bin/bash
# start repl at docker container
lein repl