Skip to content

Instantly share code, notes, and snippets.

@yoonchulkoh
yoonchulkoh / copy_calendar.js
Last active December 4, 2019 01:38
自分のカレンダーを会社のカレンダーにコピーする
// https://qiita.com/howdy39/items/b92c9ba0b050151a889b
var scriptProperties = PropertiesService.getScriptProperties();
var nextSyncTokenKey = 'NEXT_SYNC_TOKEN';
var otherDestinationCalendarId = '[コピー先のカレンダーのメールアドレス]';
function calendarUpdatedSample(e) {
console.info('calendarUpdatedSample() ------------------------------');
console.log('authMode:%s/calendarId:%s/triggerUid:%s', e.authMode, e.calendarId, e.triggerUid);
@yoonchulkoh
yoonchulkoh / AppDelegate.swift
Last active May 24, 2022 06:06
AppRootController
//
// AppDelegate.swift
// FirebaseSample
//
// Created by Yoonchul Koh on 2018/10/01.
// Copyright © 2018 Yoonchul Koh. All rights reserved.
//
import UIKit
@yoonchulkoh
yoonchulkoh / medical_checkup.rb
Created May 14, 2017 09:35
iTS健康診断ページから空き情報一覧を取得する
require 'open-uri'
require 'nokogiri'
require 'mechanize'
namespace :scrape do
desc '健康診断ページから空き情報一覧を取得する'
task :medical_checkup => :environment do
@courses = {
# 1 => "1日人間ドック(午前)",
2 => "健保指定ドック(午前)",
@yoonchulkoh
yoonchulkoh / Bond.batchUpdate.swift
Created December 8, 2016 07:16
Usage Bond batchUpdate
import UIKit
import Bond
class ViewController: UIViewController {
let items: MutableObservableArray<String> = MutableObservableArray<String>([])
override func viewDidLoad() {
super.viewDidLoad()
This file has been truncated, but you can view the full file.
ab_IS, "February 14, 2016", MDY
ab_IE, "February 14, 2016", MDY
ab_AZ, "February 14, 2016", MDY
ab_AF, "Bahman 25, 1394 AP", MDY
ab_US, "February 14, 2016", MDY
ab_VI, "February 14, 2016", MDY
ab_AS, "February 14, 2016", MDY
ab_AE, "February 14, 2016", MDY
ab_DZ, "February 14, 2016", MDY
ab_AR, "February 14, 2016", MDY
@yoonchulkoh
yoonchulkoh / open_all_storyboards.sh
Last active September 14, 2015 01:31
Open All Storyboards and Xibs
find ./ -name "*.storyboard" -or -name "*.xib" | while read line; do open $line; done
@yoonchulkoh
yoonchulkoh / main_location.min.js
Created August 12, 2015 18:10
kindle highlights
(function(b){void 0==document.createElement("div").innerText&&Object.defineProperty(HTMLElement.prototype,"innerText",{get:function(){return this.textContent},set:function(a){this.textContent=a}});var d=b.querySelector(".title").innerText,e=b.querySelector(".author").innerText,f=b.querySelectorAll(".highlight");b=b.querySelectorAll(".k4pcReadMore");var g=parseInt(document.querySelector(".boldText").innerText),c=0,a=[];a.push('<div class="book_info">');a.push('<span class="title">'+d+"</span><br />");a.push('<span class="author">'+e+"</span>");a.push("</div>");for(a.push('<div class="highlights">');c<g;c++)a.push("<hr />"),a.push("<p>"+f[c].innerText+"</p>"),a.push('<p><a href="'+b[c].href+'">'+b[c].innerText+"</a></p>");a.push("</div>");document.title=d;document.body.innerHTML=a.join("");document.body.style.fontSize = '1em'})(document);
@yoonchulkoh
yoonchulkoh / crash_notify.js
Created June 26, 2015 01:15
Google SpreadSheetからSlackに投げるスクリプト。GAS。refs: http://qiita.com/y_koh/items/81d8648914a893ec2d16
function getCrashCount() {
SpreadsheetApp.flush();
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var values = rows.getValues();
var threeDaysStartRow = 22;
var yesterdayStartRow = 36;
var count = 10;
@yoonchulkoh
yoonchulkoh / dmmEikaiwa.js
Last active November 8, 2017 23:26
DMM英会話スケジュール自動登録スクリプト
/*
* DMM英会話のスケジュールを登録する
*/
var CALENDAR_NAME = 'YOUR CALENDAR NAME';
var SEARCH_QUERY = 'is:unread subject:"【DMM英会話】レッスン予約完了のお知らせ"';
function registDMMEikaiwaCalendar() {
// 指定したカレンダーを取得
var calendars = CalendarApp.getCalendarsByName(CALENDAR_NAME);
var calendar;
@yoonchulkoh
yoonchulkoh / file0.txt
Created February 16, 2015 12:32
UILabelで行間を調節したい。ただし、折り返しの場合は行間はデフォルトで。 ref: http://qiita.com/y_koh/items/4f6c6eb3d8c8cd691c81
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
NSArray *texts = [text componentsSeparatedByString:@"\n"];
int i = 0;
for (NSString *text in texts) {
if (i > 0) {
// 行間用の改行を追加
NSMutableAttributedString *lf = [[NSMutableAttributedString alloc] initWithString:@"\n\n"];
UIFont *font = [UIFont systemFontOfSize:4.0f];
[lf addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, lf.length)];
[attributedString appendAttributedString:lf];