Skip to content

Instantly share code, notes, and snippets.

@yoonchulkoh
yoonchulkoh / app.js
Last active December 19, 2015 19:19
ドットインストールBackbone.js入門のサンプルソースにコメント付けました。 http://dotinstall.com/lessons/basic_backbonejs
(function() {
///////////////////////////////////////
// モデル定義
///////////////////////////////////////
// タスクモデル
var Task = Backbone.Model.extend({
defaults: {
title: 'do something',
completed: false
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no width=200px initial-scale=0.7" >
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Slide Puzzle</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<style>
.grid {
@yoonchulkoh
yoonchulkoh / SBDataMail.rb
Created January 27, 2014 23:56
My SoftBank通信量確認画面の情報をスクレイピングしてメール通知するスクリプト
require "mechanize"
require "yaml"
# 設定ファイル
config = YAML.load_file("config.yml")
# スクレイピング準備
agent = Mechanize.new
agent.user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36"
agent.max_history = 1
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="テスト計画" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="ユーザー定義変数" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@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];
@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 / 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 / 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 / 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
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