Skip to content

Instantly share code, notes, and snippets.

View DRSDavidSoft's full-sized avatar
Working on projects

David Refoua DRSDavidSoft

Working on projects
View GitHub Profile
@DRSDavidSoft
DRSDavidSoft / adsremover-init.js
Last active December 28, 2021 23:54
Ads Remover JS
!function(a,d,s,f,u,c,k){var sentinel = function(){var e,n,t,i=Array.isArray,r={},o={};return{on:function(a,s){if(s){if(!e){var f=document,l=f.head;f.addEventListener("animationstart",function(e,n,t,i){if(n=o[e.animationName])for(e.stopImmediatePropagation(),t=n.length,i=0;i<t;i++)n[i](e.target)},!0),e=f.createElement("style"),l.insertBefore(e,l.firstChild),n=e.sheet,t=n.cssRules}(i(a)?a:[a]).map(function(e,i,a){(i=r[e])||(a="!"==e[0],r[e]=i=a?e.slice(1):"sentinel-"+Math.random().toString(16).slice(2),t[n.insertRule("@keyframes "+i+"{from{transform:none;}to{transform:none;}}",t.length)]._id=e,a||(t[n.insertRule(e+"{animation-duration:0.0001s;animation-name:"+i+";}",t.length)]._id=e),r[e]=i),(o[i]=o[i]||[]).push(s)})}},off:function(e,a){(i(e)?e:[e]).map(function(e,i,s,f){if(i=r[e]){if(s=o[i],a)for(f=s.length;f--;)s[f]===a&&s.splice(f,1);else s=[];if(!s.length){for(f=t.length;f--;)t[f]._id==e&&n.deleteRule(f);delete r[e],delete o[i]}}})},reset:function(){r={},o={},e&&e.parentNode.removeChild(e),e=0}}}(document)
@DRSDavidSoft
DRSDavidSoft / cmder-bash.bat
Created February 25, 2018 21:40
Starts cmder+cygwin from context menu
@echo off & cd /d %0\..
set PWD=%~1
set CMDER_ROOT=C:\development\cmder
set CYGWIN_ROOT=C:\development\cygwin
set BASH_COMMAND=pushd "%CYGWIN_ROOT%" ^& "%CYGWIN_ROOT%\bin\bash" --login -i -c 'cd "`cygpath -au \"%PWD:\=/%\"`"; exec bash' ^& popd
set CONEMU_SWITCHES=-new_console:m:/mnt -new_console:a
start "Cygwin Shell" %CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.exe /icon "%CYGWIN_ROOT%\bin\mintty.exe" /title Bash /loadcfgfile "%CMDER_ROOT%\config\ConEmu.xml" /cmd cmd /c "%BASH_COMMAND%" %CONEMU_SWITCHES%
@DRSDavidSoft
DRSDavidSoft / validateNID.js
Last active March 31, 2024 08:41
Example js code to validate Iran's National ID also known as the Code Melli – کد نمونه جاوا اسکریپت برای بررسی صحت و تأیید کد ملی.
/**
* Example Javascript snippet to validate Iran's National ID (Code Melli)
* https://math.stackexchange.com/q/2740295/285467
* David Refoua <David@Refoua.me>
*/
function validateNID( code )
{
var str = code.toString();
// validate the string length and value
@DRSDavidSoft
DRSDavidSoft / Monokai.flutecolors
Created January 30, 2019 01:04
Monokai Color Scheme for FluentTerminal/Cmder
{
"Name": "Monokai",
"Author": "David Refoua <David@Refoua.me>",
"Colors": {
"Foreground": "#F8F8F0",
"Background": "#282828",
"Cursor": "#f8f8f0",
"CursorAccent": "#272822",
"Selection": "rgba(73, 72, 62, 0.3)",
"Black": "#2E3436",
@DRSDavidSoft
DRSDavidSoft / git_branches
Last active November 6, 2022 09:13
Working with git branches
# fetch upstream branches
## git fetch upstream
# create local branch test from upstream master
git checkout -b test upstream/master
# do some stuff
git add src
git commit -m "did some stuff"
@DRSDavidSoft
DRSDavidSoft / readme.md
Last active December 9, 2021 05:14
Microsoft Error Issues

Introduction

There is an increasingly annoying trend among many development tools nowadays to intentionally omit useful information when displaying an error message to the end-user. It has become a habit for developers behind many popular software, where they would actively try to hide such information from the user.

This also includes Microsoft products.

I don't agree with these kinds of desicions; and in contrast to what the product designers might perceive, I believe the actions to hide information to be a bad UX design.

While there might be several reasons as to why this might be useful (removing sensitive information, etc),

@DRSDavidSoft
DRSDavidSoft / mikrotik-scripting.md
Created December 24, 2022 09:40
Mikrotik Commands

Change TeamViewer Destination IP

/ip firewall nat edit [find where comment ~ "TeamViewer"] to-addresses    
@DRSDavidSoft
DRSDavidSoft / useless_sites.md
Created February 3, 2023 11:11
Useless Sites

Description

This is a list of sites that appear in Google search results, with "solutions" to your issue that are either general obvious crap, irrelevant, or otherwise useless.

Incentives

  1. Sponsor or sell their equaly useless products (e.g. Wondershare, Easeus, etc)
  2. Display ads in order to make money

Examples

  1. Fix Cursor Flicker on Windows 11