Skip to content

Instantly share code, notes, and snippets.

View xTCry's full-sized avatar
🦉
Power On

Vladislav Khr xTCry

🦉
Power On
View GitHub Profile
@ozh
ozh / new empty git branch.md
Last active May 29, 2024 00:00
Create a new empty branch in Git
$ git checkout --orphan NEWBRANCH
$ git rm -rf .

--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.

You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.

@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active July 16, 2024 03:38
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@cecilemuller
cecilemuller / mjpeg.js
Last active December 30, 2022 14:35
Emit a looped serie of images as an MJPEG stream using Node.js
'use strict';
const {readFileSync} = require('fs');
const {createServer} = require('http');
const {EventEmitter} = require('events');
let bufferIndex = -1;
const buffers = [
readFileSync('1.jpg'),
readFileSync('2.jpg'),
readFileSync('3.jpg'),
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
use Bitrix\Main\Mail\Event,
Bitrix\Main\Application,
\Bitrix\Main\Loader;
Loader::includeModule("iblock");
$request = Application::getInstance()->getContext()->getRequest();
<?
class YoutubeVideo
{
function __construct($video)
{
$this->video = $video;
}
private function Prefix()
@xTCry
xTCry / README.md
Last active March 8, 2021 17:26
VK Widget date, weeks

VK Widget Недельности

Пример того, как получить год, день и т.д. из Unix time

Т.к. в Widgets group в ВК нету возможности в JS работать с Data, пришлось вот так извратиться

Недельность в группу

@micalevisk
micalevisk / .progress.
Last active August 31, 2023 00:01
📋 Reading List (updated at: 05/09/2022 22:13:43 [America/Manaus])
Articles █████████████▋░░░░░░░ 65.1%
Videos ██████████████████▌░░ 88.3%
Books ████████▋░░░░░░░░░░░░ 41.4%
Learn React ████████████░░░░░░░░░ 57.1%
Learn TypeScript █████████████████████ 100.0%
GitHub ████████████████▊░░░░ 80.0%
const crypto = require('crypto') //модуль для криптографии Nodejs
const { stringify } = require('querystring') //методы для парсинга строки
const url = require('url')
const URL =
'https://example.com/?vk_user_id=494075&vk_app_id=6736218&vk_is_app_user=1&vk_are_notifications_enabled=1&vk_language=ru&vk_access_token_settings=&vk_platform=android&sign=exTIBPYTrAKDTHLLm2AwJkmcVcvFCzQUNyoa6wAjvW6k',
CLIENT_SECRET = 'wvl68m4dR1UpLrVRli'
const checkVKQueryParamsSign = params => {
@xTCry
xTCry / README.md
Last active May 6, 2020 14:42
Bitrix ShortCode baguetteBox.js or owl with swipebox Gallery

Bitrix ShortCode baguetteBox.js or OwlCarousel2 with swipebox Gallery

Простая галерея для Bitrix по shortCode из Инфоблока

Файлы

  • gallery.php должен находиться в дирректории /bitrix/templates/SITE_TEMPLATE_ID/component_handlers/
  • result_modifier.php должен быть в каждом шаблоне news.detail, где будут выводиться галереи

Использование

[gallery 000]

@negezor
negezor / bot.js
Last active February 3, 2021 21:00
Command prototype using Composition API for vk-io
const { VK } = require('vk-io');
const { Commander, useMessage, useViewer, onEnter, ref, watch } = require('./core');
const vk = new VK({
token: ''
});
const commander = new Commander();