Skip to content

Instantly share code, notes, and snippets.

Avatar

Hyeonseok Shin hyeonseok

View GitHub Profile
@hyeonseok
hyeonseok / base.css
Last active November 3, 2021 05:09
Default style which removes brower specific designs. Suitable for most of RWD sites.
View base.css
/* reset */
html {
-webkit-text-size-adjust: 100%;
}
button {
-webkit-tap-highlight-color: rgba(255,255,255,0);
-webkit-tap-highlight-color: transparent;
outline: 0 none;
}
button::-moz-focus-inner {
View brute_force_pdf.py
# https://www.thepythoncode.com/article/crack-pdf-file-password-in-python
import pikepdf
from tqdm import tqdm
# load password list
passwords = []
for y in range(70, 99):
for m in range(1, 12):
for d in range(1, 31):
@hyeonseok
hyeonseok / Emmet.sublime-settings
Last active October 9, 2020 08:49
Private setting for Emmet for Sublime text 2
View Emmet.sublime-settings
{
"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 Date.toThings.js
// https://twitter.com/umaar/status/1205249225962995717
Object.getOwnPropertyNames(Date.prototype)
.filter(name => name.startsWith('to'))
.map(method => `${method}: ${(new Date())[method]()}`)
/*
0: "toUTCString: Fri, 13 Dec 2019 03:39:10 GMT"
1: "toLocaleString: 2019. 12. 13. 오후 12:39:10"
2: "toLocaleDateString: 2019. 12. 13."
@hyeonseok
hyeonseok / today.js
Last active September 23, 2018 01:27
Now in "Ymd His" format.
View today.js
const now = new Date();
const YMD = `${now.getFullYear()}-${`0${now.getMonth() + 1}`.slice(-2)}-${`0${now.getDate()}`.slice(-2)}`;
const His = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`
@hyeonseok
hyeonseok / SwapScroll.js
Last active August 2, 2018 09:15
Swap window scroll from main content to modal window, and vise versa.
View SwapScroll.js
// 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);
@hyeonseok
hyeonseok / userContent.css
Last active April 13, 2017 07:10
UserCSS for Firefox.
View userContent.css
/**
* 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;
@hyeonseok
hyeonseok / Scene.js
Last active February 15, 2017 06:17
Scene slide
View Scene.js
/*
#scenes .scene.animate{transition: left 0.7s;}
#scenes .scene.in{left:0;}
#scenes .scene.left{left:-100%;}
#scenes .scene.right{left:100%;}
*/
var Scene = (function () {
var scenes = [];
var sceneSequence = '0';
View transparent-data-uri.gif.txt
# 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
@hyeonseok
hyeonseok / console.log.to.div.html
Last active February 1, 2016 07:00
console.log to screen, for those who debugs on old browser.
View console.log.to.div.html
<div id="trace" style="position: absolute; z-index: 99999; top: 0; right: 0; border: 2px solid #0c0; background: #fff; color: #0c0; font: 11px monospace;"></div>
<script>
var console = {
log: function trace() {
var msg = Array.prototype.slice.call(arguments).join(' ');
document.getElementById('trace').innerHTML += msg.toString() + '<br>';
}
}
console.log(navigator.userAgent);
</script>