This file contains hidden or 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 | |
| define('COCKPIT_ADMIN', 1); | |
| // set default url rewrite setting | |
| if (!isset($_SERVER['COCKPIT_URL_REWRITE'])) { | |
| $_SERVER['COCKPIT_URL_REWRITE'] = 'Off'; | |
| } | |
| // set default timezone |
This file contains hidden or 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
| var data = [ | |
| { | |
| title: "Одежда", | |
| left: 1, | |
| right: 22 | |
| }, | |
| { | |
| title: "Мужская", | |
| left: 2, | |
| right: 9 |
This file contains hidden or 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 CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" | |
| const uniqid = () => { | |
| let now = Date.now(), chars = [], i = 8, id | |
| while (i--) { | |
| chars[i] = CHARS.charAt(now % 64) | |
| now = Math.floor(now / 64) | |
| } | |
| id = chars.join("") | |
| while (i++ < 8) { |
This file contains hidden or 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
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { | |
| // no easing, no acceleration | |
| linear: function (t) { return t }, | |
| // accelerating from zero velocity | |
| easeInQuad: function (t) { return t*t }, | |
| // decelerating to zero velocity |
This file contains hidden or 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 h(type, props, ...children) { | |
| props = props != null ? props : {}; | |
| return { type, props, children }; | |
| } | |
| function render(vdom, parent = null) { | |
| if (parent) parent.textContent = ""; | |
| const mount = parent ? (el => parent.appendChild(el)) : (el => el); | |
| if (typeof vdom == "string" || typeof vdom == "number") { | |
| return mount(document.createTextNode(vdom)); |
This file contains hidden or 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
| P = (pow(e + 2.5) + 7.1 * pow(h, 3)) / (log(sqrt(y + 0.04 * h))); |
This file contains hidden or 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 compose = (...fns) => arg => fns.reduce((composed, f) => f(composed), arg) | |
| const oneSecond = () => 1000 | |
| const getCurrentTime = () => new Date() | |
| const clear = () => console.clear() | |
| const log = message => console.log(message) | |
| const serializeClockTime = date => ({ | |
| hours: date.getHours(), | |
| minutes: date.getMinutes(), |
This file contains hidden or 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
| { | |
| "font_size": 10, | |
| "tab_size": 2, | |
| "translate_tabs_to_spaces": true, | |
| "indent_to_bracket": true, | |
| "trim_trailing_white_space_on_save": true, | |
| "ensure_newline_at_eof_on_save": true, | |
| "save_on_focus_lost": true, | |
| "copy_with_empty_selection": false, | |
| "drag_text": false, |
This file contains hidden or 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
| text | |
| .replace(/\n{3,}/, '\n\n') | |
| .replace(/\n+$/, '\n\n') | |
| .replace(/(#+)(.+?)\n/gm, (p, h, m) => `\n<h${h.length}>${m.trim()}</h${h.length}>\n`) | |
| .replace(/^([^\n<][\S\s]+?)\n\n/gm, (p, m) => `<p>${m.trim()}</p>\n\n`) | |
| .replace(/\*\*([\S ]+?)\*\*|__([\S ]+?)__/g, (p, m1, m2) => `<b>${m1||m2}</b>`) | |
| .replace(/\*([\S ]+?)\*|_([\S ]+?)_/g, (p, m1, m2) => `<em>${m1||m2}</em>`) |
This file contains hidden or 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
| #include <iostream> | |
| using namespace std; | |
| int gcd(int a, int b) { | |
| while (a != b) { | |
| if (a > b) { | |
| a = a - b; | |
| } else { | |
| b = b - a; | |
| } |