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
const el = document.querySelector('.el'); | |
elA.addEventListener('animationend', () => { | |
elA.classList.remove('.animating'); | |
}): | |
// triggers CSS animation which time varies | |
elA.classList.add('.animating'); | |
// How to check that the class `animating` is rightly removed when the animation finishes? |
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
/** | |
* CSS Coding Tips: Trust your eyes | |
*/ | |
div { | |
position: absolute; | |
top: 100px; | |
} | |
span { |
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
/** | |
* CSS Coding Tips: Inheritance | |
*/ | |
div { | |
margin-top: 50px; | |
position: relative; | |
border: 1px solid black; | |
background: pink; | |
} |
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
/** | |
* CSS Coding Tips: Maintainability versus brevity | |
*/ | |
div { | |
position: absolute; | |
top: calc(50% - 25px); | |
left: calc(50% - 25px); | |
height: 50px; | |
width: 50px; |
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
/** | |
* CSS Coding Tips : Minimize code duplication | |
*/ | |
button { | |
padding: 6px 16px; | |
border: 1px solid #446d88; | |
background: #58a linear-gradient(#77a0bb, #58a); | |
border-radius: 4px; | |
box-shadow: 8 1px 5px gray; |
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
ls | ruby -ne 'BEGIN{puts("lets go");$array = []};$array << $_.chomp;END{puts $array.inspect;puts "finished"}' |
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
#!/bin/bash | |
# アクセス数を抽出するスクリプト | |
# yyyy/dd/*.log.bz2 しか対応しない | |
# アクセスログから月単位でユーザID(整数5桁)毎にアクセス数をCSVファイルに提出 | |
declare -A USERS | |
# 6月から8月まで | |
months=( 6 7 8 ) | |
output=~/access_count_per_user.csv | |
for month in ${months[@]};do |
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
package main | |
import ( | |
"code.google.com/p/go-tour/tree" | |
"fmt" | |
) | |
func Walk(t *tree.Tree, ch chan int) { | |
if t.Left != nil { | |
Walk(t.Left, ch) |
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
package main | |
import ( | |
"io" | |
"os" | |
"strings" | |
"unicode" | |
) | |
type rot13Reader struct { |
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
package main | |
import ( | |
"code.google.com/p/go-tour/pic" | |
"image" | |
"image/color" | |
) | |
const DIM = 1024 |