Skip to content

Instantly share code, notes, and snippets.

View ykhs's full-sized avatar

Yukihisa Yamada ykhs

  • Autify, Inc.
  • Tokyo, Japan
View GitHub Profile
@ykhs
ykhs / chapter4_list13.js
Created October 22, 2014 02:54
JavaScript養成読本 特集1 第4章 リスト13 訂正
var Todo = Backbone.Model.extend({
defaults: {
title: '',
completed: false
}
});
var TodoView = Backbone.View.extend({
template: '<label>' +
' <input class="toggle" type="checkbox">' +
@ykhs
ykhs / chapter6_list8.js
Last active March 9, 2017 03:35
JavaScript養成読本 特集1 第6章 リスト8 訂正
// js/note_list_item.js
App.NoteListItemView = Backbone.View.extend({
tagName: 'tr',
render: function() {
var template = $('#noteListItemView-template').html();
var compiled = _.template(template);
var html = compiled(this.model.toJSON());
this.$el.html(html);
return this;
@ykhs
ykhs / chapter7_list1.js
Created October 22, 2014 03:06
JavaScript養成読本 特集1 第7章 リスト1 訂正
App.NoteListItemView = Backbone.View.extend({
tagName: 'tr',
initialize: function() {
// モデルのdestroyイベントを監視して
// Backbone.Viewのremove()メソッドを呼び出す
this.listenTo(this.model, 'destroy', this.remove);
},
// [Delete]ボタンを監視して
// onClickDelete()メソッドを呼び出す
events: {
@ykhs
ykhs / chapter7_list5.js
Created October 22, 2014 03:09
JavaScript養成読本 特集1 第7章 リスト5 訂正
// js/note_detail.js
App.NoteDetailView = Backbone.View.extend({
render: function() {
var template = $('#noteDetailView-template').html();
var compiled = _.template(template);
var html = compiled(this.model.toJSON());
this.$el.html(html);
return this;
}
function peco_select_branch
set -l query (commandline)
if test -n $query
set peco_flags --query "$query"
end
git branch | peco --prompt "GIT BRANCH>" $peco_flags | sed -e "s/^\* //g" -e "s/^ //g" | read line
if [ $line ]
local wezterm = require "wezterm"
local config = wezterm.config_builder()
local act = wezterm.action
-- Colors
config.color_scheme = "iceberg-dark"
-- Font
config.font = wezterm.font("Moralerspace Neon")
config.font_size = 16.0