Skip to content

Instantly share code, notes, and snippets.

View jyxjjj's full-sized avatar
🇳🇱
NL

ShenLin jyxjjj

🇳🇱
NL
View GitHub Profile
@jyxjjj
jyxjjj / Fix L G Hub App Icon.sh
Created August 8, 2024 02:03
FROM 2024.6.600476
#!/bin/zsh
brew update && brew upgrade imagemagick
iconutil -c iconset --output ~/Downloads/icon.iconset /Applications/lghub.app/Contents/Resources/icon.icns
magick ~/Downloads/icon.iconset/[email protected] -resize 512x512 ~/Downloads/icon.iconset/icon_512x512.png
magick ~/Downloads/icon.iconset/[email protected] -resize 512x512 ~/Downloads/icon.iconset/[email protected]
magick ~/Downloads/icon.iconset/[email protected] -resize 256x256 ~/Downloads/icon.iconset/icon_256x256.png
<?php /** @noinspection PhpComposerExtensionStubsInspection */
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Process;
use SQLite3;
class DecryptChromeCookies extends Command
{
@jyxjjj
jyxjjj / CountryCodeToEmoji.php
Last active March 19, 2024 02:07
ISO-3166-1-Alpha-2 Country Code to Unicode Emoji
<?php
function countryCodeGetEmoji($countryCode = 'XX', $continent = 'XX'): string
{
try {
if (strlen($countryCode) !== 2) {
throw new InvalidArgumentException('Invalid country code');
}
if ($countryCode === 'XX') {
return mb_convert_encoding("&#x1F310;", 'UTF-8', 'HTML-ENTITIES');
}
@jyxjjj
jyxjjj / MariaDBError.php
Created September 8, 2023 07:00
Temporary MariaDB Error Codes Enum
<?php
namespace DESMG\MariaDB\V11_0_2;
enum MariaDBError: int
{
/** hashchk */
case ER_HASHCHK = 1000;
/** isamchk */
case ER_NISAMCHK = 1001;
@jyxjjj
jyxjjj / performance.sh
Last active January 7, 2025 04:43
<CPU Freq Settings On Linux> (Updated to `Intel Core I3-13100`)
#!/bin/bash
for i in {0..7}; do
# min cpu freq to 3.4GHz
echo 3400000 > "/sys/devices/system/cpu/cpu$i/cpufreq/scaling_min_freq"
# set max cpu freq to 4.5GHz
echo 4500000 > "/sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
# set cpu preference to performance
echo performance > "/sys/devices/system/cpu/cpu$i/cpufreq/energy_performance_preference"
# set cpu governor to performance
echo performance > "/sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
@jyxjjj
jyxjjj / GET.php
Created October 12, 2022 03:52
cURL PHP GET POST
<?php
function GET($url, $user_agent = 'CURL', $proxy_type = CURLPROXY_SOCKS5_HOSTNAME, $proxy = null, $header = null, $timeout = 10)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
$header != null && curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$proxy != null && curl_setopt($ch, CURLOPT_PROXYTYPE, $proxy_type);
$proxy != null && curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Media</title>
<link rel="dns-prefetch" href="https://unpkg.com">
<link rel="preconnect" href="https://unpkg.com">
<link href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div>
@jyxjjj
jyxjjj / tmooc.py
Last active August 9, 2021 04:08
Tmooc Downloader - To generate TMOOC videos' download links and ffmpeg commands.
#-*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import re
import time
import os, sys
from urllib import parse