Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

View saberhosneydev's full-sized avatar

Saber Hosney saberhosneydev

Software engineer, interested in medicine, psychology and play video games
View GitHub Profile
@saberhosneydev
saberhosneydev /CompleteDiscordQuest.md
Last activeDecember 14, 2025 13:02— forked fromaamiaa/CompleteDiscordQuest.md
Complete Recent Discord Quest

Note

This does not works in browser for quests which require you to play a game! Use thedesktop app to complete those.

How to use this script:

  1. Accept a quest under Discover -> Quests
  2. PressCtrl+Shift+I to open DevTools
  3. Go to theConsole tab
  4. Paste the following code and hit enter:

There are two metrics that are important to consider when discussing the size of Docker images.

  1. Compressed size - This is often referred to as the wire size. This affects how fast/slow images can be pulled from a registry. This impacts the first run experience on machines where images are not cached.
  2. Uncompressed size - This is often referred to as the size on disk. This affects how much local storage is required to support your Docker workloads.

The example commands shown below will work on Windows, MacOS, and Linux.

How to Measure the Compressed Size

@saberhosneydev
saberhosneydev /session-life-cycle.md
CreatedMay 10, 2023 11:26— forked frommindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP'sSessionHandlerlife-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when andwhat you can expect will be called in your customSessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see theresulting calls being made to a custom session-handler registed usingsession_set_save_handler().

@saberhosneydev
saberhosneydev /CategoriesOps.php
Last activeNovember 8, 2022 23:58
Order & Sort Categories of unknown levels(Tree data structure) in laravel.
<?php
namespaceApp;
useIlluminate\Database\Eloquent\Collection;
class CategoriesOps
{
protectedCollection$inputData;
protectedCollection$rootParents;
@saberhosneydev
saberhosneydev /footgun.md
CreatedOctober 21, 2022 04:06— forked fromRich-Harris/footgun.md
Top-level `await` is a footgun

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't blocksibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing(async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal,which you can read here.

I'll leave the rest of this document unedited, for archaeological

@saberhosneydev
saberhosneydev /ping_with_timestamp.ps1
Last activeMarch 3, 2022 14:44
This will allow to ping a host n number of times while logging each request timestamp and status. things you should edit is "E:\pingresults" path on line 2 adjust to a path of your choice and don't forget to actually create the folder. Change 9999 to the number of requests you want, google.com for the hostname and finally change the partial path…
$time="$(get-date-f yyyy-MM-dd__HH-mm)"
New-Item-Path"E:\pingresults"-Name"$time.txt"-ItemType"file"
Test-Connection-Count9999-ComputerNamegoogle.com|Format-Table@{Name='TimeStamp';Expression= {Get-Date } }, Address, Latency, Status|Tee-Object-file"E:\pingresults\$time.txt"-append
@saberhosneydev
saberhosneydev /deploy.sh
Last activeSeptember 22, 2021 02:06
Building spring boot application ( using gradle ) on the cloud and using a script on the server for deployment
#!/bin/bash
owner="ownerName"
repo="repoName"
GITHUB_API_TOKEN="PTA with repo permission"
GH_API="https://api.github.com"
GH_REPO="$GH_API/repos/$owner/$repo"
VERSION=$1
RELEASES="$GH_REPO/releases"
AUTH="Authorization: token$GITHUB_API_TOKEN"
@saberhosneydev
saberhosneydev /ssh_connect.bat
Last activeFebruary 22, 2021 18:00
Connecting to ssh server using Windows 10 built-in ssh client
ssh -i fileName.pem user@host
PAUSE
/*
* Communication Processor Module v2.
*
* This file contains structures and information for the communication
* processor channels found in the dual port RAM or parameter RAM.
* All CPM control and status is available through the CPM2 internal
* memory map. See immap_cpm2.h for details.
*/
#ifdef __KERNEL__
#ifndef __CPM2__
NewerOlder

[8]ページ先頭

©2009-2025 Movatter.jp