Skip to content

Instantly share code, notes, and snippets.

chestozo

Block or report user

Report or block chestozo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View history-debug-wrapper.js
(function() {
const methods = [ 'pushState', 'replaceState', 'back', 'forward', 'go' ]
const _originals = {}
methods.forEach((m) => {
_originals[m] = window.history[m]
window.history[m] = function() {
console.log('XXX', m, arguments)
return _originals[m].apply(window.history, arguments)
}
View gcloud.yml
steps:
- name: node:10.16.3
entrypoint: yarn
args: ['build']
@chestozo
chestozo / timer.js
Created Jun 5, 2019
Measure time after click
View timer.js
document.addEventListener('click', () => {
const dt = Date.now();
const clockElement = document.createElement('div');
Object.assign(clockElement.style, {
position: 'absolute',
top: 0,
right: 0,
background: '#FAA',
'z-index': 9999,
padding: 5
View loadscript.js
// Part of manifest.js generated by webpack:
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.charset = 'utf-8';
script.async = true;
script.timeout = 120000;
script.crossOrigin = "anonymous";
if (__webpack_require__.nc) {
script.setAttribute("nonce", __webpack_require__.nc);
View fffile.md

Did you know that two spaces at the end of the line
are actually a line break? Do you see it?

And here is what you get without any spaces at end of the line.

View fat-arrow-class-method-example.js
class MyDuperClass {
onClick = () => {
this.doSomeStuff();
}
}
View flex-columns.css
/**
* Задача
* - container резиновый
* - внутри 2 колонки
* - левая - резиновая
* - при этой левая не тянется больше, чем позволяет контейнер
* - правая - фиксированной ширины
*
* HTML
* <div class="parent">
View recreate-git-submodule.sh
# Based on http://stackoverflow.com/a/1260982/449345
# The most mneeeeee part is this one: `rm -rf .git/modules/mmmodule`
# This script can be useful in case you are changing origin for your
# nice and cool mmmodule.
git submodule deinit -f mmmodule
rm -rf .git/modules/mmmodule # kind of WAAAAT?!
git submodule init mmmodule
git submodule update --recursive
@chestozo
chestozo / design.css
Created May 9, 2016
Additional styles for the booking form
View design.css
#book_termsAndConditions_box a:link, #book_termsAndConditions_box a:hover, #book_termsAndConditions_box a:visited, #book_termsAndConditions_box a:active { text-decoration: none; }
#book_termsAndConditions_box a:link, #book_termsAndConditions_box a:visited { color:#F60; }
#book_termsAndConditions_box a:hover, #book_termsAndConditions_box a:active { color:#ffb32f; }
View wrap.js
function wrap(obj, onlyOwnProperties) {
obj = obj || {};
for (var propName in obj) {
if (onlyOwnProperties && obj.hasOwnProperty(propName)) {
continue;
}
if (typeof obj[propName] !== 'function') {
continue;
You can’t perform that action at this time.