This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.NoteListItemView = Backbone.View.extend({ | |
tagName: 'tr', | |
initialize: function() { | |
// モデルのdestroyイベントを監視して | |
// Backbone.Viewのremove()メソッドを呼び出す | |
this.listenTo(this.model, 'destroy', this.remove); | |
}, | |
// [Delete]ボタンを監視して | |
// onClickDelete()メソッドを呼び出す | |
events: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Todo = Backbone.Model.extend({ | |
defaults: { | |
title: '', | |
completed: false | |
} | |
}); | |
var TodoView = Backbone.View.extend({ | |
template: '<label>' + | |
' <input class="toggle" type="checkbox">' + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ContactView = Backbone.View.extend({ | |
template: '<div>Name: <%= firstName %> <%= lastName %></div>' + | |
'<div>Email: <%= email %></div>', | |
render: function() { | |
var compiled = _.template(this.template); | |
var html = compiled(this.model.toJSON()); | |
this.$el.html(html); | |
return this; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ContactView = Backbone.View.extend({ | |
render: function() { | |
// HTMLテンプレートを取得する | |
var template = $('#contact-template').html(); | |
// HTMLテンプレートにモデルのデータを適用する | |
// モデルのtoJSON()メソッドを使って属性を | |
// オブジェクトの形式で書き出す | |
var compiled = _.template(template) | |
var html = compiled(this.model.toJSON()); | |
// 自身が保持しているDOM要素を更新する |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.apply(null,Array(100)).map(function(i,j){++j;i='';!(j%3)&&(i='fizz');!(j%5)&&(i+='buzz');console.log(i||j)}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domParse = function(htmlString) { | |
var doc; | |
doc = document.implementation.createHTMLDocument(''); | |
doc.body.innerHTML = htmlString; | |
return doc.body.firstChild; | |
}; |
NewerOlder