View diff2html.php
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
<?php | |
/* | |
http://hyeonseok.com/soojung/dev/2013/09/02/743.html | |
git diff -U1 --word-diff > ../diff.txt | |
Execute this command from repository then run this script. | |
*/ | |
$diff_file = file('diff.txt'); |
View right-click.js
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 () { | |
var d = document; | |
d.oncontextmenu = null; | |
d.ondragstart = null; | |
d.onselectstart = null; | |
d.body.style.MozUserSelect = ''; | |
})(); |
View Emmet.sublime-settings
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
Show hidden characters
{ | |
"snippets": | |
{ | |
"css": | |
{ | |
"snippets": | |
{ | |
"tf": "-webkit-transform: ${1:func};\n-moz-transform: $1;\n-ms-transform: $1;\n-o-transform: $1;\ntransform: $1;", | |
"ts": "-webkit-transition: ${1:func};\n-moz-transition: $1;\n-ms-transition: $1;\n-o-transition: $1;\ntransition: $1;" | |
} |
View azaa.php
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
<?php | |
function tests($expect, $actual) { | |
if ($expect == $actual) { | |
echo('PASS'); | |
} else { | |
echo('FAIL'); | |
} | |
echo(': ' . $expect . '/' . $actual . PHP_EOL); | |
} |
View emphasis.js
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 emphasisKeyword(keyword, string) { | |
var h = { e: "[eéê]", a: "[aáâ]" }; | |
var matched = keyword.match(/[\S\s]/g); | |
var res = []; | |
for (var i = 0; i < matched.length; i++) { | |
if (h[matched[i]]) { | |
res.push(h[matched[i]]); | |
} else { |
View userContent.css
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
/** | |
* UserCSS for Firefox. | |
* https://gist.github.com/hyeonseok/7243239 | |
* | |
* ln -s ~/Dropbox/src/firefox-usercss/userContent.css /Users/hyeonseok/Library/Application\ Support/Firefox/Profiles/{USER_PROFILE}/chrome/userContent.css | |
*/ | |
* { | |
-webkit-touch-callout: text !important; | |
-webkit-user-select: text !important; |
View android_version.php
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
<?php | |
$str = '~~ Android 2.2.1; ~~'; | |
function get_android_version($str) { | |
$start = strpos($str, ' Android '); | |
if ($start === false) { | |
return ''; | |
} | |
$remains = substr($str, $start); | |
$end = strpos($remains, ';'); | |
$remains = substr($remains, 0, $end); |
View random.html
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
<!DOCTYPE html> | |
<html lang="ko"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>추첨기</title> | |
<style> | |
html, | |
body { | |
height: 100%; | |
} |
View transparent-data-uri.gif.txt
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
# blank | |
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 | |
# 10% black | |
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAADUExURQkJCQC1BbgAAAABdFJOUxq9hCEcAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg== | |
# 20% black | |
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAADUExURQoKBSBopAkAAAABdFJOUzP/NrlwAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg== | |
# 30% black | |
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAADUExURQ0JBpcDsPUAAAABdFJOU01Ii+VLAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg== | |
# 40% black |
View SwapScroll.js
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
// Needs to be clean up. | |
var mainContent = document.getElementById('main'); | |
var open = function (target) { | |
var closeButton = target.querySelector('p.button button'); | |
mainContent.style.top = -1 * document.body.scrollTop + 'px'; | |
mainContent.style.position = 'fixed'; | |
target.setAttribute('aria-hidden', 'false'); | |
document.body.scrollTop = 0; | |
closeButton.addEventListener('click', close); |
OlderNewer