Skip to content

Instantly share code, notes, and snippets.

@keisei1092
keisei1092 / playbook.yml
Last active November 20, 2022 11:39
Ansibleの(とりあえずCakePHPとMySQLのsecure_installation以外) https://gist.github.com/keisei1092/621f2b122eb957040b05 これも必要
# playbook.yml
---
- hosts: all
sudo: true
user: vagrant
tasks:
- name: Vimをインストールする
yum: name=vim state=present
- name: zshをインストールする
yum: name=zsh state=present
@keisei1092
keisei1092 / my_confs.json
Last active March 21, 2019 11:36
Karabiner-Elements configuration
{
"title": "my confs",
"description": "karabiner is god",
"rules": [
{
"description": "ctrl-m to enter",
"manipulators": [
{
"type": "basic",
"from": {
@keisei1092
keisei1092 / danbooru_downloader.rb
Created January 13, 2019 12:13
[WIP] Danbooru Downloader
require 'httparty'
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'downloaded'))
response = HTTParty.get 'https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=hatsune_miku&json=1'
response
.parsed_response
.map { |r| { r['file_url'] } }
.tap { |r| puts r }
# .each { |u|

youtube-dl-cheetsheet

youtube-dlを使ってタスクを便利にこなすためのスニペット集

Pythonistaで使えるやつ

import youtube_dl, os, appex
@keisei1092
keisei1092 / wav2mp3.md
Last active June 30, 2018 14:57
指定したディレクトリにあるwavファイルを320kbpsのmp3ファイルに変換する

wav2mp3

指定したディレクトリにあるwavファイルを320kbpsのmp3ファイルに変換する
変換されたwavファイルは自動で削除します

Prerequisites

  • ffmpeg がインストールされていること
    • Homebrew がインストールされているmacOSなら brew install ffmpeg で入る
  • trash がインストールされていること
brew install youtube-dl
@keisei1092
keisei1092 / 20170507_tsunagarumirai_namecard.md
Last active August 26, 2017 15:47
Twiplaからスクレイピングして名刺作るやつ
@keisei1092
keisei1092 / 20170507_nico_playcount_share_tool.md
Last active May 7, 2017 04:09
ニコニコのマイリスから再生数を得るやつ

やれること

現在のマイリスの全体再生数をTwitterに投げる

やりたいこと

定期実行
遅延処理(getthumbinfoをディレイなしにリクエストしまくってる)
前回との変化分を表示
鯖に上げて誰でも使えるように

@keisei1092
keisei1092 / vocalonobis_watcher.rb
Created April 16, 2017 06:56
新着ツイートを監視してニコニコのURLを含んでいたらなにかするやつ
# 新着ツイートを監視してニコニコのURLを含んでいたらなにかするやつ
#
# Usage
# gem install tweetstream
# CONSUMER_KEY= CONSUMER_SECRET= OAUTH_TOKEN= OAUTH_SECRET= ruby vocalonobis_watcher.rb
require 'tweetstream'
class String
def includesNicoUrl?
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<title>skyline</title>
</head>
<body style="background-color: #F2F2F2; height: 100%; padding-left: 10%; padding-right: 10%;">
<textarea style="
margin: 0;
border: none;
width: 100%;