Skip to content

Instantly share code, notes, and snippets.

View Eboubaker's full-sized avatar
🐐

Eboubaker Bekkouche Eboubaker

🐐
  • Soft-lines LLC
  • Eloued, Algeria
  • 05:31 (UTC +01:00)
View GitHub Profile
@Eboubaker
Eboubaker / script.reg
Created September 24, 2021 07:29
Add an entry "Run without privilege elevation" to windows file context menu.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
@="Run without privilege elevation"
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
@="cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"%1\"\""
https://blog.penjee.com/wp-content/uploads/2015/02/pass-by-reference-vs-pass-by-value-animation.gif
@Eboubaker
Eboubaker / usefull apps.txt
Created October 18, 2021 15:48
usefull apps, programs
NetSpeedMonitor
TreeSize
Everything
@Eboubaker
Eboubaker / request.ts
Last active November 3, 2021 14:20
My custom graphql apollo client request helper
import {DocumentNode} from "graphql";
import apollo from "@/grapthql/apollo"; // pre-configured apollo client (authorization...etc)
/**
* contains apollo request helpers
*/
const request = {
/**
* send an apollo mutate request
* @param mutation the gqlMutation definition
@Eboubaker
Eboubaker / ..steps.md
Last active November 25, 2021 19:52 — forked from kiddtang/.env-Swoole
[Youtube - Boosts your Laravel Sail] a youtube guide from https://www.youtube.com/watch?v=0KjyubRdtvA

TL;DR Configuration steps

  • curl -s https://laravel.build/proj | bash
  • cd proj
  • alias sail="vendor/bin/sail"
  • sail up -d
  • sail npm install
  • sail npm install --save-dev chokidar
  • sail composer install laravel/octane
  • sail artisan octane:install select swoole
  • add swoole configuration into config/octane.php
@Eboubaker
Eboubaker / ideas.md
Last active November 29, 2021 19:48

Make filtering needs on the client side

Intro

I got this idea when i knew that if you do console.log on a function you will get the source code of it

const filter = user => !user.deleted && user.age > 19
console.log(filter.toString)// "user => !user.deleted && user.age > 19"

Frontend

We might be able to use this as a filter for graphql request with the combination of input filters, we parse the source code of filter function into a graphql input filters and send them with the request. as an example lets call our extractor function "extractFilters", The extractor should extract an array of filters such that the filter is definied as

@Eboubaker
Eboubaker / wsl-install.md
Last active December 17, 2021 18:35
1 click install WSL and docker on windows

1 click install WSL and docker on windows

In privileged powershell

#Powershell in Administrator mode
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart
# install choco
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Restart-Computer -Confirm
@Eboubaker
Eboubaker / programs.md
Last active December 1, 2021 18:00
script to Install required applications after clean windows 10 install

Install required applications after clean windows 10 install

In privileged powershell

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco feature disable -n=allowGlobalConfirmation

Essentials

choco install vlc
choco install winrar
@echo off
wt wsl -e ssh eboubaker@eboubaker.xyz
@Eboubaker
Eboubaker / index.php
Last active August 19, 2022 19:26
Serve files in the current directory to the network.
<?php
$files = array_diff(scandir('.'), ['.', '..', 'index.php']);
if(empty($files)) die("no files in directory .");
foreach ($files as $f) {
echo "<div style='font-size: 1.3em;padding-left: 15px'><a href='$f'>$f</a></div>";
}