Skip to content

Instantly share code, notes, and snippets.

View Yehonal's full-sized avatar

Yehonal Yehonal

View GitHub Profile
@Yehonal
Yehonal / partialPrimeNumber.pseudocode
Created March 19, 2024 08:21
NestDev - Simple Prime Number Pseudocode (To Complete)
FUNCTION IsPrime(num, primeNumbers)
IF num <= 1 THEN
RETURN FALSE
ENDIF
IF num IN primeNumbers THEN
RETURN TRUE
ENDIF
FOR i FROM 2 TO num - 1 DO
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@Yehonal
Yehonal / trinitycore-installer.sh
Last active February 24, 2020 07:59
[WIP] Trinitycore full installer & run for Debian 10
#!/usr/bin/env bash
apt-get update -y
apt-get install curl unzip tmux p7zip-full git clang cmake make gcc g++ libmariadbclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mariadb-server p7zip default-libmysqlclient-dev -y
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
git clone -b 3.3.5 --depth=2 git://github.com/TrinityCore/TrinityCore.git
cd TrinityCore
mkdir build
@Yehonal
Yehonal / .gitignore
Last active January 7, 2019 16:49
standard .gitignore
#
#
# Git ignore file
#
# NOTE: Insert your custom rules at the end of this file
#
!.gitignore
#
# make a copy of the relevant library
mkdir ~/lib
cp /usr/lib/x86_64-linux-gnu/libxcb.so.1 ~/lib
sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' ~/lib/libxcb.so.1
# set the dynamic loader path to put your library first before executing VS Code
LD_LIBRARY_PATH=$HOME/lib code
@Yehonal
Yehonal / azerothcore_ubuntu_installer.sh
Last active November 26, 2018 05:01
This simple script allows you to install AZeroThCore in a single step. From a fresh ubuntu installation to a fully working server where you can play! Demo: https://www.youtube.com/watch?v=j1HI6pLZZvM
#!/usr/bin/env bash
# DESCRIPTION OF FOLLOWING COMMAND
# 0. time: this command is used to print the total time elapsed to install the entire system
# 1. apt-get: install git and screen tools
# 2. git clone: download azerothcore repository and install
# 3. install duel-reset module (it's just an example of how to install a module via our dashboard)
# 4. initialize azerothcore project
# 5. download client data
# 6. run authserver in background
# 7. run worldserver in background
@Yehonal
Yehonal / wp_option_active_plugins_filter.php
Last active June 26, 2017 17:54
[WORDPRESS] Useful filter that allows to exclude specific plugins from a specified ajax action improving performances
/**
* Useful filter that allows to exclude specific plugins from a specified ajax action improving performances
* Depending on quantity of active plugin, it can extremely speedup your ajax calls
* NOTE: to exclude plugins from specific pages improving website response please use Plugin Organizer https://it.wordpress.org/plugins/plugin-organizer/
*/
add_filter('option_active_plugins', function ($plugins) {
if (!defined('DOING_AJAX') || !DOING_AJAX)
return $plugins;
// CONFIGURATION:
@Yehonal
Yehonal / index.js
Created May 5, 2015 12:35
requirebin sketch
var URI = require( 'URIjs/src/URI.fragmentURI' );
document.body.style.whiteSpace = 'pre';
var uri = URI( 'http://example.com/#!?page=test' );
uri.fragmentPrefix( '!' );
var fragment = uri.fragment( true );
log( uri );