Skip to content

Instantly share code, notes, and snippets.

@yuumi3
yuumi3 / rec_radiko.sh
Last active February 25, 2021 01:38 — forked from matchy256/rec_radiko.sh
簡易Radiko録音スクリプト
#!/bin/bash
LANG=ja_JP.utf8
pid=$$
date=`date '+%Y-%m-%d-%H_%M'`
outdir="/var/www/html/radiko"
rsspath="/var/www/html/radiko.rss"
@yuumi3
yuumi3 / addTodoTask.js
Last active December 25, 2018 05:29
addTodoTask
const TODO_PATH = '/Notes/TODO.md'
const fetch = require('isomorphic-fetch')
const Dropbox = require('dropbox').Dropbox
const dbx = new Dropbox({ accessToken: process.env["TOKEN"], fetch: fetch })
const mmdd = (d) => `${d.getMonth() + 1}/${d.getDate()}`
exports.handler = async (event, context, callback) => {
try {
const task = event.task ? event.task : "TEST"
const apn = require('apn')
const OPTIONS = {
cert: "./PushNotificationAlert-cert.pem",
key: "./PushNotificationAlert-key.pem",
production: false
}
const MESSAGES = {"DOUBLE": "お腹がすいた!", "LONG": "たすけてぇ〜"}
exports.handler = (event, context, callback) => {
let message = ""
@yuumi3
yuumi3 / send_url_mail.rb
Created April 6, 2017 01:25
Send Radiko recorded mail
#!/usr/bin/env ruby
def mail(to_addr, subject, body)
open("|mail -s '#{subject}' #{to_addr}", "w") {|io| io.puts body}
end
file_name = ARGV[0]
mail 'yy@ey-office.com', "Radiko 録音完了 #{file_name}" ,
"Download http://ey-office.net/radiko/#{file_name}.mp3\r\n" +
"Download http://ey-office.net/radiko/#{file_name}.flv"
@yuumi3
yuumi3 / rec_radiko.sh
Created April 6, 2017 01:24
Radiko recorder
#!/bin/bash
LANG=ja_JP.utf8
pid=$$
date=`date '+%Y-%m-%d-%H_%M'`
#playerurl=http://radiko.jp/player/swf/player_4.1.0.00.swf
playerurl=http://radiko.jp/apps/js/flash/myplayer-release.swf
playerfile="/tmp/player.swf"
keyfile="/tmp/authkey.png"
@yuumi3
yuumi3 / Gemefile
Created May 26, 2016 08:56
Gemefile
#
ruby '2.3.0'
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
#!/usr/bin/env ruby
require 'io/console'
GIT_LIST_PATH = "#{ENV['HOME']}/tmp/git-demo.lst"
RED = "\e[31m"
YELLOW = "\e[33m"
BLACK = "\e[30m"
FIN = "\e[0m"
@yuumi3
yuumi3 / redmine_textile2md.rb
Last active October 28, 2019 01:30
Convert Textile to Markdown contents in Redmin
def textile_to_markdown(textile)
d = []
pre = false
table_header = false
text_line = false
textile.each_line do |s|
s.chomp!
#!/usr/bin/env ruby
require 'taglib'
MP_FILE_CLASSES = {'.mp3' => TagLib::MPEG::File, '.m4a' => TagLib::MP4::File}
def set_mp_audio_file_to_title(path, title)
MP_FILE_CLASSES[File.extname(path)].open(path) {|mp| mp.tag.title = title; mp.save}
puts " set #{path} title=#{title}"
rescue
@yuumi3
yuumi3 / rack_logger.rb
Created July 18, 2014 00:06
Add USER_AGENT to Rails log. config/initializers/rack_logger.rb
module Rails
module Rack
class Logger < ActiveSupport::LogSubscriber
# Add UserAgent
def started_request_message(request)
'Started %s "%s" for %s at %s by %s' % [
request.request_method,
request.filtered_path,
request.ip,
Time.now.to_default_s,