Skip to content

Instantly share code, notes, and snippets.

@YusukeIwaki
YusukeIwaki / ggrks.js
Created November 20, 2019 05:59
ぐぐれかすをpuppeteerでサクッと
// yarn init -y
// yarn add puppeteer-core
const puppeteer = require("puppeteer-core");
const launchChrome = puppeteer.launch({
// MacにインストールされているChromeを使う。
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
// ブラウザ画面を表示しながら(ヘッドレスモードを無効にする)。
@YusukeIwaki
YusukeIwaki / japanese_cmd_space.json
Last active July 11, 2019 03:53 — forked from keik/japanese.json
Karabiner-Elements で command + space での IME トグル
{
"title": "For Japanese",
"rules": [
{
"description": "toggle eisuu with command + space",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
@YusukeIwaki
YusukeIwaki / docker-compose.yml
Created March 12, 2019 15:39
Elasticsearch + Kibana
version: '2.2'
services:
elasticsearch:
image: elasticsearch:5.6
environment:
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
@YusukeIwaki
YusukeIwaki / upgrade_ubuntu.sh
Created February 17, 2019 07:12
Cloud9 proでubuntu 18.04
#!/bin/sh
sudo apt-get update
sudo apt-get -y install update-manager-core
sudo do-release-upgrade
npm install -g @vue/cli
vue create プロジェクト名
cd プロジェクト名/
vue add electron-builder
yarn electron:serve
$ bundle exec rails new -h
Usage:
rails new APP_PATH [options]
Options:
[--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated applications)
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /usr/local/rvm/rubies/ruby-2.5.3/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
eval "$(direnv hook bash)"
export EDITOR=/usr/bin/nano
#export PS1='\h:\W \u\$ ' # もともと入ってた値
source /usr/local/etc/bash_completion.d/git-prompt.sh
source /usr/local/etc/bash_completion.d/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\h:\W $(if [ -d .git ]; then __git_ps1 " \e[32m(%s)\e[m" ; else echo \u; fi) \$ '
class Ten
include Enumerable
def initialize
end
def each(&block)
10.times.each(&block)
end
end
@YusukeIwaki
YusukeIwaki / rakuten_bank_walking.js
Created June 11, 2018 19:53
puppeteer-page-walkerを使った、楽天銀行残高の確認コード
const userId = "??????????????";
const loginPassword = "???????????";
const branchCode = "???";
const accountNumber = "???????";
const secretWords = {
"卒業した中学校": "???????",
"母親の旧姓": "??????",
"??????": "??????"
};
apt-get update
apt-get install -y ant exuberant-ctags tomcat7 unzip || true
mkdir /tmp/opengrok
wget https://github.com/OpenGrok/OpenGrok/files/467358/opengrok-0.12.1.6.tar.gz.zip -O /tmp/opengrok.tar.gz.zip
wget http://jflex.de/release/jflex-1.6.1.tar.gz -O /tmp/jflex.tar.gz
unzip /tmp/opengrok.tar.gz.zip -d /tmp/
tar xzvf /tmp/opengrok-0.12.1.6.tar.gz -C /tmp/opengrok
tar xzvf /tmp/jflex.tar.gz -C /tmp/opengrok
cp /tmp/opengrok/jflex-1.6.1/lib/jflex-1.6.1.jar /tmp/opengrok/opengrok-0.12.1.6/lib/
cp -Rap /tmp/opengrok/opengrok-0.12.1.6/bin /usr/local/