Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

souhaiebtar

:octocat:
Focusing
View GitHub Profile
@souhaiebtar
souhaiebtar / Vagrantfile.ru
Created Jul 27, 2020
[vagrant cluster] a vagrant cluster configuration #vagrant #cluster
View Vagrantfile.ru
servers=[
{
:hostname => "manager",
:ip => "192.168.100.10",
:box => "bento/ubuntu-16.04",
:ram => 1024,
:cpu => 2
},
{
:hostname => "worker-1",
@souhaiebtar
souhaiebtar / decrypt-jwt.js
Created Jul 22, 2020
[decrypt JWT] js function to decrypt JWT tokent #js #javascript
View decrypt-jwt.js
function decryptJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
return JSON.parse(jsonPayload);
};
@souhaiebtar
souhaiebtar / run.cmd
Created Jul 6, 2020
[reset trial] jetbrains 2020.1 #jetbrains #windows
View run.cmd
set PRODUCT=WebStorm2020.1
set JETBRAINSDIR=%USERPROFILE%\AppData\Roaming\JetBrains
rmdir /S /Q %JETBRAINSDIR%\%PRODUCT%\eval
rmdir /S /Q %JETBRAINSDIR%\consentOptions
del %JETBRAINSDIR%\%PRODUCT%\options\other.xml
del %JETBRAINSDIR%\PermanentDeviceId
del %JETBRAINSDIR%\PermanentUserId
del %JETBRAINSDIR%\bl
del %JETBRAINSDIR%\crl
@souhaiebtar
souhaiebtar / run.sh
Last active Jul 8, 2020
[reset trial] jetbrains 2020.1 #trial #linux
View run.sh
#!/bin/sh
# reset jetbrains ide evals
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
for PRD in $JB_PRODUCTS; do
rm -rf ~/.java/.userPrefs/prefs.xml
rm -rf ~/.java/.userPrefs/jetbrains/prefs.xml
rm -rf ~/.config/JetBrains/${PRD}*/eval/
@souhaiebtar
souhaiebtar / jetbrains-key-activation.txt
Last active Jun 25, 2020 — forked from imgVOID/jetbrains-key-activation.txt
JetBrains key activation 2020-2021 IntelliJ WebStorm PyCharm PhpStorm
View jetbrains-key-activation.txt
2020 JetBrains activation working method: license servers' addresses & keys!
Big thanks to JBFamily China community for this activation method. Was successfully tested on 04/10/2020 for PyCharm version 19.3
PLZ star & fork my repo, it can be deleted by DMCA!
https://github.com/imgVOID/jetbrains-license-2020
FIRST YOU NEED TO NECESSARILY BLOCK ALL JETBRAINS SERVERS' ADDRESSES
ADRESSES LIST: https://pastebin.com/W7jA0v8a
(Linux + MacOS) /etc/hosts Change this file ownership into your name. so that you can edit. command: sudo chown username /etc/hosts
@souhaiebtar
souhaiebtar / ReadMe.md
Created Jun 17, 2020
[create mysql server 5.7 using docker] create a mysql server using docker #mysql #docker
View ReadMe.md
docker run --name mysql-5.7 -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d mysql:5.7.30
@souhaiebtar
souhaiebtar / commands.md
Created Jun 5, 2020
[closure-compiler cheatSheet] cheatsheet for google closure-compiler minimizer and optimizer for js #optimize #minimize #js #javascript
View commands.md

curl -fL https://dl.google.com/closure-compiler/compiler-latest.zip -o closure-compiler.zip

minimize a single js file java -jar ./closure-compiler.jar --js admin-ajax.php --js_output_file admin-ajax.min.php

compile multiple script all together with one compile command java -jar compiler.jar --js_output_file=out.js in1.js in2.js in3.js

enable advanced_optimizations

@souhaiebtar
souhaiebtar / cleanStringify.js
Created Jun 4, 2020
[stringify circular Json structure] stringify circular json structure in javascript #js #javascript #circular
View cleanStringify.js
function cleanStringify(object) {
if (object && typeof object === 'object') {
object = copyWithoutCircularReferences([object], object);
}
return JSON.stringify(object);
function copyWithoutCircularReferences(references, object) {
var cleanObject = {};
Object.keys(object).forEach(function(key) {
var value = object[key];
View st4 linux build 4074
printf '\00\00\00' | dd of=sublime_text bs=1 seek=282268 count=3 conv=notrunc
https://www.google.com/search?q=%22EA7E-890007%22
@souhaiebtar
souhaiebtar / key.txt
Last active Jul 25, 2020 — forked from rufoa/instructions.sh
sublime merge 2 build 2020 linux
View key.txt
----- BEGIN LICENSE -----
TEAM RUFIO
Unlimited User License
E52D-666666
487EE6F0309908F702DDD52AFCD99A6A
6EE14CF8A2D42271B4FC0991BBF93ADC
FAA9075C436B3796669194A2F36CAAEF
B251155329EC2E434FD28B4A21BE68CC
955D306EE9ED843C5E98B1577D02DEAA
1F4E872AE6495CD5E3B1DA55D5ACD2B2
You can’t perform that action at this time.