This file contains 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
#!/bin/bash | |
# Configuration variables | |
PROCESS_ID=1 # PM2 process ID | |
DOMAIN_URL=https://example.com # Domain to check | |
CHECK_INTERVAL=10 # Interval for HTTP check in seconds | |
SERVICE_DIRECTORY=path-to-folder/ # Directory of the web service | |
# Function to check HTTP status code | |
check_http_status() { |
This file contains 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
#CUSTOM | |
# Load version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats ' (%b)' | |
setopt PROMPT_SUBST |
This file contains 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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const filePath = process.argv[2]; | |
if(!filePath) { | |
console.error('No file specified.\nUsage:\n\tnode crxver.js my-extensions.crx\n'); | |
process.exit(-1); | |
} | |
const buf = fs.readFileSync(filePath); |
This file contains 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
#!/bin/bash | |
echo -n -e "File type:\t" | |
xxd -l 4 $1 | awk '{for(i=NF; i>3; --i) print $NF}' | |
echo -n -e "Version:\t" | |
xxd -l 1 -c 1 -ps -s 4 $1 |
This file contains 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
cd /Volumes/boot | |
nano wpa_supplicant.conf | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
network={ | |
ssid="YOUR_NETWORK_NAME" | |
psk="YOUR_PASSWORD" | |
key_mgmt=WPA-PSK | |
} |
This file contains 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
// # 1st way | |
var context = new AudioContext(); | |
var source = context.createMediaElementSource(document.querySelector('.video-stream.html5-main-video')); | |
//Now we want to create a filter | |
var filter = context.createBiquadFilter(); | |
source.connect(filter); //and of course connect it | |
filter.type = "highshelf"; //this is a lowshelffilter (try excuting filter1.LOWSHELF in your console) | |
filter.frequency.value = 200; //as this is a lowshelf filter, it strongens all sounds beneath this frequency |
This file contains 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
/** | |
* Takes a screenshot from video. | |
* @param videoEl {Element} Video element | |
* @param scale {Number} Screenshot scale (default = 1) | |
* @returns {Element} Screenshot image element | |
*/ | |
function getScreenshot(videoEl, scale) { | |
scale = scale || 1; | |
const canvas = document.createElement("canvas"); |
This file contains 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 guid() { | |
function s4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
s4() + '-' + s4() + s4() + s4(); | |
} |
This file contains 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
<?xml version="1.0"?> | |
<project name="Clipboard History" basedir="." default="tester"> | |
<property name="build_dir" value="../scm_build" /> | |
<property name="dest_dir" value="../scm_build/scm" /> | |
<property name="src_dir" value="." /> | |
<!-- ДЛЯ ТЕСТЕРОВ --> | |
<target name="tester" description="Сборка в папку для тестеров"> | |
<!-- Создаем каталог для билда --> | |
<mkdir dir="${build_dir}" /> |
This file contains 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 arrayBufferToBase64(buffer) { | |
let binary = ''; | |
let bytes = new Uint8Array(buffer); | |
let len = bytes.byteLength; | |
for (let i = 0; i < len; i++) { | |
binary += String.fromCharCode(bytes[i]); | |
} | |
return window.btoa(binary); | |
} |
NewerOlder