Skip to content

Instantly share code, notes, and snippets.

Avatar

umihico

View GitHub Profile
@umihico
umihico / result.json
Created Oct 6, 2019
Scrap all city names from wikipedia
View result.json
{"A Coru\u00f1a": "Spain", "Aachen": "Germany", "Aalborg": "Denmark", "Aarhus": "Denmark", "Aba, Nigeria": "Nigeria", "Abadan, Iran": "Iran", "Abaetetuba": "Brazil", "Abakan": "Russia", "Abbotabad": "Pakistan", "Abbotsford, British Columbia": "Canada", "Abengourou": "Ivory Coast", "Abeokuta": "Nigeria", "Aberdeen": "United Kingdom", "Abha": "Saudi Arabia", "Abidjan": "Ivory Coast", "Abiko, Chiba": "Japan", "Abilene, Texas": "United States", "Abohar": "India", "Abu Al-Khaseeb": "Iraq", "Abu Dhabi": "United Arab Emirates", "Abu Ghraib": "Iraq", "Abuja": "Nigeria", "A\u00e7ail\u00e2ndia": "Brazil", "Acapulco": "Mexico", "Acarigua": "Venezuela", "Accra": "Ghana", "Achalpur": "India", "Acheng District": "China", "Achinsk": "Russia", "Adama": "Ethiopia", "Adana": "Turkey", "Adapazar\u0131": "Turkey", "Addis Ababa": "Ethiopia", "Adelaide": "Australia", "Aden": "Yemen", "Adhamiyah": "Iraq", "Adilabad": "India", "Adityapur": "India", "Ad\u0131yaman": "Turkey", "Ado-Ekiti": "Nigeria", "Adoni": "India", "Afyon": "Turkey
@umihico
umihico / lambda_function.py
Created Sep 3, 2019
AWS Lambda function to return image
View lambda_function.py
import requests
import base64
def lambda_handler(event, content):
response = requests.get("https://github.com/umihico.png")
return {
"isBase64Encoded": True,
"statusCode": 200,
"headers": { "content-type": "image/jpg"},
"body": base64.b64encode(response.content).decode("utf-8")
}
@umihico
umihico / README.md
Last active Sep 3, 2019
Download Python Pillow package for AWS lambda
View README.md
  1. run docker-compose up.
  2. confirm you get PIL and Pillow-6.1.0.dist-info directory next .yml file.
  3. upload them as AWS Lambda Layer
@umihico
umihico / api.php
Last active Jul 12, 2019
Get CSV as array from input form with ajax in Laravel 5.8.14
View api.php
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
@umihico
umihico / scraping.py
Last active Jun 24, 2019
佐川の支店一覧を出力するスクリプト
View scraping.py
from selenium.webdriver import Chrome
from umihico.xlsx import to_xlsx
from time import sleep
c=Chrome()
urls=[
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=17",
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=15",
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=16",
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=14",
"https://www2.sagawa-exp.co.jp/company/branch/list/?sub_b_id=13",
@umihico
umihico / .alias
Last active Apr 14, 2019
My aliases on Mac
View .alias
alias ls='ls -lhaGF'
alias pas='php artisan serve'
alias p='python'
alias a='atom'
alias d='docker'
alias c='pbcopy'
alias s='source'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
@umihico
umihico / .bash_profile
Last active May 6, 2019
my macbook setup procedures
View .bash_profile
export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
source ~/.bashrc
@umihico
umihico / README.md
Last active Jan 26, 2019
my atom settings
View README.md

my atom settings

  • changing wallpaper, colors (styles.less)
  • changing tabe25m wallpaper (tabe25m.less)