This file contains hidden or 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
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<!-- このスタイルは文書ツリー側に定義したものなので Shadow DOM 内部には適用されない。 --> | |
<style> | |
section.articleBox h1 { | |
color: black; | |
} |
This file contains hidden or 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 password = [].reduce.call('AaBbCcDdEeFfGgHhiJjKkLMmNnPpQqRrSsTtWwXxYyz3456789', function(p, c, i, a) { | |
return p += a.replace(new RegExp(p.split('').join('|'), 'g'), '')[Math.floor(Math.random() * (a.length - p.length))]; | |
}, '').substr(0, 16); | |
console.log(password); |
This file contains hidden or 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
global <<< require \prelude-ls | |
fizzbuzz = (x) -> | |
| x % 15 is 0 => \fizzbuzz | |
| x % 5 is 0 => \buzz | |
| x % 3 is 0 => \fizz | |
| otherwise => x | |
[1 to 100] |> map fizzbuzz |> each console.log |
This file contains hidden or 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
do | |
<-! $ | |
initializeApp! | |
data <-! $.get 'ajaxtest' | |
$ \.result .html data | |
processed <-! $.get 'ajaxprocess', data | |
$ \.result .append processed |
This file contains hidden or 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
@mixin linear-gradient($angle, $color-stops...) { | |
$_angle-with-vendor-prefix: ""; | |
$_angle: ""; | |
@if $angle == "to top" or $angle == "bottom" { | |
$_angle-with-vendor-prefix: bottom; | |
$_angle: to top; | |
} @else if $angle == "to right" or $angle == "left" { | |
$_angle-with-vendor-prefix: left; | |
$_angle: to right; | |
} @else if $angle == "to bottom" or $angle == "top" { |
This file contains hidden or 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
require 'net/http' | |
require 'rexml/document' | |
class Palette | |
attr_accessor :name, :url, :colors | |
def initialize(id) | |
@name = String.new | |
@url = String.new | |
@colors = Array.new |
This file contains hidden or 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; | |
}; |
This file contains hidden or 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 hidden or 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 hidden or 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; | |
} |