Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View yus-ham's full-sized avatar
🌴
On vacation

Yusup Hambali yus-ham

🌴
On vacation
View GitHub Profile
#!/usr/bin/env xdg-open
# file: ~/.local/share/applications/ide.desktop
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=VS Code URL Handler
Comment=Handle URL Scheme ide://
@yus-ham
yus-ham / slimselect.css
Created May 5, 2023 05:22
slim-select@2.x-dev
:root{--ss-primary-color: #5897fb;--ss-bg-color: #ffffff;--ss-font-color: #4d4d4d;--ss-font-placeholder-color: #8d8d8d;--ss-disabled-color: #dcdee2;--ss-border-color: #dcdee2;--ss-highlight-color: #fffb8c;--ss-success-color: #00b755;--ss-error-color: #dc3545;--ss-main-height: 30px;--ss-content-height: 300px;--ss-spacing-l: 7px;--ss-spacing-m: 5px;--ss-spacing-s: 3px;--ss-animation-timing: 0.2s;--ss-border-radius: 4px}@keyframes ss-valueIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes ss-valueOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.ss-hide{display:none !important}.ss-main{display:flex;flex-direction:row;position:relative;user-select:none;color:var(--ss-font-color);min-height:var(--ss-main-height);width:100%;padding:var(--ss-spacing-s);cursor:pointer;border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);outline:0;box-sizing:border-box;transition:background-color var(--ss-animation-timing);
@yus-ham
yus-ham / ci-github.php
Last active October 21, 2023 13:22
Auto pull by webhooks
<?php
$CI_SECRET = 'xxxxx';
$BASE_DIR = '/var/www/html/';
$_SERVER['REQUEST_METHOD'] === 'POST' OR die(header('HTTP/1.1 405').'#METHOD_NOT_ALLOWED');
$data = file_get_contents('php://input');
$sign = substr($_SERVER['HTTP_X_HUB_SIGNATURE_256'] ??null, 7) OR die(header('HTTP/1.1 400').'#SIGNATURE');
const tls = require("tls");
const net = require("net");
var DeviceId = "b98c4fba-bfc5-4538-99f3-2a0859283947";
var SessionToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEifQ.eyJkZXZpY2UiOnsiaWQiOiJiOThjNGZiYS1iZmM1LTQ1MzgtOTlmMy0yYTA4NTkyODM5NDcifSwic2Vzc2lvbiI6eyJwbGF5ZXJJZCI6InJvZjRfX2NrYmh2M3Z2YTAwNXI4Z2xtY3RrZWdzdjEiLCJleHRyYSI6eyJwbGF0Zm9ybSI6IkFuZHJvaWQiLCJwcm9maWxlIjoiM181X2ZiYW5kX1BBQkVRNFZpbGxhZ2VFbmQifX0sImlhdCI6MTYxNjQ5NDM5MywiZXhwIjoxNjE2NTUxOTkzfQ.mWIqfbDFmzo0WjLOBh1dyDg9l-DonKoVEt6EFJ1ZyVY";
var UserId = "rof4__ckbhv3vva005r8glmctkegsv1";
// var TriplePromotion = "3f2e02554ead75a6e0461112cd17265e9b20a09cf201932509891f68bbe4025c";
// var item_code = "com.moonactive.cm.softcurrency.pack.V292.16";
// var offer_index = "3";
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
sudo add-apt-repository ppa:xapienz/curl34
sudo apt-get update
Ref
- https://launchpad.net/~xapienz/+archive/ubuntu/curl34
- https://www.ngemu.com/threads/ubuntu-bionic-libcurl-so-4-curl_openssl_3-not-found.204577/#post-2716097
@yus-ham
yus-ham / svelte-template-syntax.md
Last active January 23, 2022 19:16
update: cc445839e3172 - jan 14
  1. Install from source (recommended)

Please download the source packages from Releases or:

git clone https://github.com/swoole/swoole-src.git
cd swoole-src
git pull
git checkout v4.x.x -f

Compile and install at the source folder:

@yus-ham
yus-ham / MultiPartFromStrings.php
Created August 24, 2019 13:05 — forked from iansltx/MultiPartFromStrings.php
Multipart file uploads in PHP from strings
<?php
/**
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile
* type). You can use php://temp to get around this for one file, but if you want to upload
* multiple files then you've got a bit more work.
*
* This function manually constructs the multipart request body from strings and injects it
* into the supplied curl handle, with no need to touch the file system.
pkexec chmod 777 /var/run/postgresql
/usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main
xfce4-terminal -e "/usr/lib/postgresql/10/bin/pg_ctl status -D /var/lib/postgresql/10/main" --hold