Skip to content

Instantly share code, notes, and snippets.

@naniwaKun
naniwaKun / main.js
Last active March 9, 2017 10:36
GoogleChromeを使って1分でツイキャスのコメントを読み上げるTips。 ref: http://qiita.com/naniwaKun/items/0b5f7028964acf618f96
var user_id = "自分のユーザーID";
function yomiyomi(text){
var synthes = new SpeechSynthesisUtterance();
synthes.voiceURI = 'native';
synthes.volume = 0.3;
synthes.rate = 1.3;
synthes.pitch = 1;
synthes.text = text;
synthes.lang = 'ja-JP';
@naniwaKun
naniwaKun / wordpress.conf
Last active March 9, 2017 04:05
nginxのwordpressのマトリョーシカ設定 ref.http://cfw4.tk/wordpress/500
server {
 listen 80;
 server_name domain;
 charset UTF-8;
 index index.php index.html index.htm;
 root /公開パス;
 try_files $uri $uri/ /index.php?q=$uri&$args;
 location ~ \.php$ {
  root /公開パス;
  fastcgi_pass 環境に合わせて書く;
@naniwaKun
naniwaKun / man.tex
Created January 23, 2017 05:35
中間発表のやり方 ref.http://cfw4.dip.jp/wordpress/56
\documentclass[slide]{beamer}
\usepackage{apalike}
\usepackage{luatexja}
%\usepackage[hiragino-pro]{luatexja-preset}
\usepackage[ipa]{luatexja-preset}
%%%% 見た目の設定
\usetheme{Pittsburgh}
\setbeamertemplate{frametitle}[default][center]
\setbeamertemplate{navigation symbols}{}
@naniwaKun
naniwaKun / archsetup.sh
Last active April 19, 2019 17:41 — forked from kunst1080/archsetup.sh
server instal by archlinux iso image on stickpc
NEWHOSTNAME=$1
ROOTPASSWD=$2
# Keymap
loadkeys jp106
# Setup HDD
sudo parted /dev/mmcblk1 mklabel gpt
parted /dev/mmcblk1 mkpart ESP fat32 1MiB 551MiB
parted /dev/mmcblk1 mkpart primary ext4 551MiB 100%
@naniwaKun
naniwaKun / tw_client_stream.rb
Last active August 20, 2017 03:59
tw クライアントのソース変更の提案 ref.https://twitter.com/naniwa_stg/status/881834161757081601
module Tw
class Client::Stream
def initialize(user=nil)
user = Tw::Auth.get_or_regist_user user
@client = Twitter::Streaming::Client.new do |config|
config.consumer_key = Conf['consumer_key']
config.consumer_secret = Conf['consumer_secret']
config.access_token = user['access_token']
config.access_token_secret = user['access_secret']
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tw/version'
Gem::Specification.new do |gem|
gem.name = "tw"
gem.version = Tw::VERSION
gem.authors = ["Sho Hashimoto"]
gem.email = ["hashimoto@shokai.org"]
gem.description = %q{CUI Twitter Client.}
@naniwaKun
naniwaKun / bot.rb
Last active August 23, 2017 08:39
ツイッターボットでアラブ人を自動フォロバしない。 ref: http://qiita.com/naniwaKun/items/f159d1e80f1fd4fb2fba
require "twitter"
require 'json'
USERNAME = "********"
client = Twitter::REST::Client.new do |config|
config.consumer_key = "********"
config.consumer_secret = "********"
config.access_token = "********"
config.access_token_secret = "********"
@naniwaKun
naniwaKun / block.rb
Last active August 23, 2017 08:39
大量にフォロバしてしまったアラブ人をブロックしてブロック解除する。 ref: http://qiita.com/naniwaKun/items/5c2582f32c7116ae89c9
require "twitter"
require 'json'
USERNAME = "********"
client = Twitter::REST::Client.new do |config|
config.consumer_key = "********"
config.consumer_secret = "********"
config.access_token = "********"
config.access_token_secret = "********"
##バックアップは真面目に取る
##特にデータベースとファイルは絶対取る
sudo su
##何もでなかったらスルー。
dpkg --get-selections | grep 'hold$'
##何もでなかったらスルー。
dpkg -l | awk '/^rc/ { print $2 }'
@naniwaKun
naniwaKun / Install.sh
Last active September 21, 2017 14:05
Install.sh
sudo apt update
sudo apt upgrade
sudo apt install gcc make python2.7 nodejs npm git
git clone git://github.com/c9/core.git c9sdk
cd c9sdk
scripts/install-sdk.sh
cd ~
sudo mv c9sdk /opt/
mkdir workspace
echo " /usr/bin/node /opt/c9sdk/server.js -l 127.0.0.1 -w $home/workspace" > cloud9