Skip to content

Instantly share code, notes, and snippets.

View Patrick-web's full-sized avatar

Just Patrick Patrick-web

View GitHub Profile
@Patrick-web
Patrick-web / eas_update_prompt.sh
Created November 18, 2023 15:49
A Bash script that interactively prompts users to select a branch and a commit message for updating an EAS project. It provides options to choose from available branches and recent commit messages, allowing confirmation before executing the 'eas update' command. Designed for convenience and ease of use in managing EAS project updates.
#!/bin/bash
# Function to extract branches from eas.json under the build section
get_branches() {
branches=$(jq -r '.build | to_entries[] | [.key] | @tsv' eas.json)
echo "$branches"
}
echo "Available branches:"
available_branches=$(get_branches)
@Patrick-web
Patrick-web / parser.js
Created September 26, 2021 02:18
JSON Bible Parser
const path = require("path");
const fs = require("fs");
function parseBible(biblePath) {
console.time("parsing time");
const files = fs.readdirSync(biblePath);
files.filter((file) => file == "books.json");
const bookNames = JSON.parse(
fs.readFileSync(path.join(biblePath, "books.json"))
).bookNames;
@Patrick-web
Patrick-web / release.js
Created September 1, 2021 12:51
Github Release Download Counter
var owner = 'Patrick-web';
var repo = 'electron-app-store';
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', function(){
const releases = JSON.parse(this.responseText);
const assets = releases.map(release=>release.assets)[0]
const info = assets.map(asset=> {
const assetInfo = {
name:asset.name,
@Patrick-web
Patrick-web / youtubemp3Downloader.ts
Created July 23, 2021 15:53
Download audio from a YouTube video
import axios from "axios";
interface AudioQualities {
"320kbs": string;
"256kbs": string;
"192kbs": string;
"128kbs": string;
}
interface Format {
@Patrick-web
Patrick-web / cheatsheet.ps1
Created July 15, 2021 06:52 — forked from pcgeek86/cheatsheet.ps1
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
const actionHandlers = [
['play', () => { /* ... */ }],
['pause', () => { /* ... */ }],
['previoustrack', () => { /* ... */ }],
['nexttrack', () => { /* ... */ }],
['stop', () => { /* ... */ }],
['seekbackward', (details) => { /* ... */ }],
['seekforward', (details) => { /* ... */ }],
['seekto', (details) => { /* ... */ }],
/* Video conferencing actions */
var context = new (window.AudioContext || window.webkitAudioContext)();
var mediaElement = document.querySelector("audio");
var source = context.createMediaElementSource(mediaElement);
let band1 = document.querySelector("#band1");
let band2 = document.querySelector("#band2");
let band3 = document.querySelector("#band3");
let band4 = document.querySelector("#band4");
let band5 = document.querySelector("#band5");
@Patrick-web
Patrick-web / getDuplicateCountForArrayElements.js
Created April 27, 2021 20:30
A snippet for getting the number of times each item in an array has been repeated
uniqueCount = [
"a",
"b",
"c",
"d",
"d",
"e",
"a",
"b",
@Patrick-web
Patrick-web / deez.revived.user.js
Created April 16, 2021 13:09 — forked from aleandroid/deez.revived.user.js
Deezer Downloader Monkey Script
//---CONFIGURATION---//
const showMp3_128 = true; // Show MP3 @128k download (default: true)
const showMp3_320 = true; // Show MP3 @320k download (default: true)
const showFLAC = true; // Show FLAC download (default: true)
const showAzLyrics = true; // Show azLyrics checkbox (default: true)
const showListDownloader = true; // Show bulk download option (default: true)
const coverSize = 600; // JPEG cover size in px (default: 600)
const coverQuality = 80; // JPEG cover quality from 0 to 100 (default: 80)
//---DEBUG---//
@Patrick-web
Patrick-web / deezer-mp3-download.js
Created February 18, 2021 12:34 — forked from adamotte/deezer-mp3-download.js
Download - stream a deezer song / playlist / album in 320kbps, for educational purposes only ;). Strongly inspired by https://github.com/jaimehrubiks/deezer-download
const Promise = require("bluebird");
const request = require("request-promise");
const ID3Writer = require('browser-id3-writer');
const crypto = require('crypto');
const format = require('util').format;
const fs = require("fs");
const http = require('http');
let type = process.argv[2];