Skip to content

Instantly share code, notes, and snippets.

View hyeonseok's full-sized avatar
🧐

Hyeonseok Shin hyeonseok

🧐
View GitHub Profile
*/10 * * * * /usr/bin/git -C /Users/hyeonseok/repo/makina-runway-product-site/www pull >> ~/Desktop/cron_log.txt 2>&1
# 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):
// 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 / Scene.js
Last active February 15, 2017 06:17
Scene slide
/*
#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';
@hyeonseok
hyeonseok / base.css
Last active November 3, 2021 05:09
Default style which removes brower specific designs. Suitable for most of RWD sites.
/* 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 {
@hyeonseok
hyeonseok / today.js
Last active September 23, 2018 01:27
Now in "Ymd His" format.
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 / console.log.to.div.html
Last active February 1, 2016 07:00
console.log to screen, for those who debugs on old browser.
<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>
@hyeonseok
hyeonseok / setPhotoSize.js
Created January 20, 2016 11:51
Fit image to the container while cropping given ratio.
_setPhotoSize: function($image) {
var cropPortion = 1.2,
imageWidth = $image.width(),
imageHeight = $image.height(),
imageRatio = imageWidth / imageHeight,
windowWidth = LayoutManager().getScreenWidth(),
windowHeight = LayoutManager().getScreenHeight(),
windowRatio = windowWidth / windowHeight,
width, height, top = 0, left = 0;
@hyeonseok
hyeonseok / layerOpen.js
Created January 15, 2016 10:12
Open layer, then close layer by clicking document.
// TODO: Add complete HTML document.
$layer: $('.layer'),
$button: $('.button'),
_initialize: function() {
$(document).on('click', this._onClick.bind(this));
},
_onClick: function(event) {