Skip to content

Instantly share code, notes, and snippets.

@monolithed
monolithed / proportional-scale.js
Created October 24, 2022 17:36 — forked from ariona/proportional-scale.js
Proportionally Scale Any HTML Content
var $el = $("#very-specific-design");
var elHeight = $el.outerHeight();
var elWidth = $el.outerWidth();
var $wrapper = $("#scaleable-wrapper");
$wrapper.resizable({
resize: doResize
});
@monolithed
monolithed / google-drive-upload.md
Last active August 5, 2021 16:36
Загрузка файла в Google Drive
  1. Откройте ваш файл и выберите "Инструменты"
  2. Выберите "Редактор скриптов"
  3. В появившемся окне вставьте первый скрипт (JS)
  4. Создайте на своем диске папку, куда будут складываться файлы
  5. Перейдите в новую папку
  6. Скопируйте в адресной строке ID папки (выглядит он примерно так 1jaST3NoIg63d0x0A1K7ppje8ZTjCWvIP)
  7. В функции saveFile замените значение ID на свой
  8. Нажмите иконку "Сохранить проект"
  9. Нажмите плюсик напротив "Файлы", чтобы добавить файл
  10. Выберите HTML
@monolithed
monolithed / kibana.md
Last active September 4, 2019 06:50
Kibana + Elasticsearch

Kibana + Elasticsearch

Установка

➜ brew tap elastic/tap
➜ brew install elastic/tap/kibana-full
➜ brew install elastic/tap/elasticsearch-full
@monolithed
monolithed / strace.md
Created August 14, 2018 12:56 — forked from graste/strace.md
strace process for network and memory and other syscalls

File activity

strace -e trace=file -fp PID (file) or strace -e trace=desc -fp PID (file descriptors)

Common calls:

  • access
  • close – close file handle
  • fchmod – change file permissions
  • fchown – change file ownership
@monolithed
monolithed / colors.sh
Last active July 24, 2018 14:44
Colors
printf '\e[%sm▒' {30..37} 0; echo ### foreground
printf '\e[%sm ' {40..47} 0; echo ### background
'use strict';
let AccountManager = require('@qa/account-manager');
let WebDriverIOUtils = require('@qa/wdio-utils');
let capabilities = require('@qa/wdio-capabilities');
let MochaHooks = require.resolve('@qa/wdio-mocha-hooks');
let minimist = require('minimist');
let VisualRegressionCompare = require('wdio-visual-regression-service/compare');
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>PokerFace</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
@monolithed
monolithed / html5-video-streamer.js
Created July 4, 2017 16:42 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
// Usage
<Router>
<Provider store={store}>
<ListeningRouter>
<Main />
</ListeningRouter>
</Provider>
</Router>
@monolithed
monolithed / file.js
Created April 24, 2017 07:28 — forked from alexcorvi/file.js
JSX without react
var React = {
createElement: function (tag, attrs, children) {
var e = document.createElement(tag);
// Add attributes
for (var name in attrs) {
if (name && attrs.hasOwnProperty(name)) {
var v = attrs[name];
if (v === true) {
e.setAttribute(name, name);