Skip to content

Instantly share code, notes, and snippets.

View iMaz1n's full-sized avatar
🔥
YOLO

Mazen M.H. iMaz1n

🔥
YOLO
View GitHub Profile
@iMaz1n
iMaz1n / gist:9225bd93cf443f03682980c0b5837bc7
Created October 6, 2019 14:06
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz && \
sudo pkgutil --forget org.macosforge.xquartz.pkg && \
rm -rf ~/.serverauth* && rm -rf ~/.Xauthorit* && rm -rf ~/.cache && rm -rf ~/.rnd && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
@iMaz1n
iMaz1n / gist:d0986f4b5e98f65c8d3babd7bfdfc92d
Created March 31, 2020 09:37 — forked from jamiemarsland/gist:5e618baeda2dd5199d4a
Remove WooThemes credit in Storefront footer
add_action( 'init', 'custom_remove_footer_credit', 10 );
function custom_remove_footer_credit () {
remove_action( 'storefront_footer', 'storefront_credit', 20 );
add_action( 'storefront_footer', 'custom_storefront_credit', 20 );
}
function custom_storefront_credit() {
?>
<div class="site-info">
@iMaz1n
iMaz1n / index.php
Created May 3, 2020 06:29 — forked from baamenabar/index.php
PHP List images in folder
<?php
/*
list all the files with extension nn on a folder
the first parameter of glob is a regex to match files.
you can do:
path_to_dir/*.html
to select all the .html files in the path_to_dir folder
*NOTE:* the regex on glob is case sensitive
@iMaz1n
iMaz1n / encrypt_openssl.md
Created August 1, 2020 05:53 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

Apple Real Devices Debugging

What you need

  • certificate--which tells your devices that Apple trust you
  • a app id
  • a test device
  • a provisioning profile
@iMaz1n
iMaz1n / lowertoupper.asm
Created December 16, 2020 15:07 — forked from wohhie/lowertoupper.asm
Assembly 8086: Lower Case to Upper Case
TITLE PGM_1: CASE CONVERSTION PROGRAM
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH
@iMaz1n
iMaz1n / 1-setup.md
Created August 9, 2021 20:33 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

@iMaz1n
iMaz1n / create-subdomain.php
Created October 17, 2021 10:30
Use API/Curl to create a new subdomain in both CloudFlare and cPanel
<?php
/**
* Create Subdomains
*
* Note: This script was designed to be called silently by a bash script for project creation.
* Add to bash script: php "$HOME/scripts/php/create-subdomains.php" "$new_account_subdomain"
*
* Requires "jamesryanbell/cloudflare": "^1.11" for the CloudFlare PHP library
* Recommends "kint-php/kint": "^3.2" for improved temporary PHP debugging
May 3, 2017 at 12:34 PM
From Apple
2. 3 Performance: Accurate Metadata
4. 2 Design: Minimum Functionality
Guideline 4.2 - Design
Thank you for your resubmission. Your app continues to provide a limited user experience as it is still not sufficiently different from a mobile browsing experience. As such, the experience it provides is similar to the general experience of using Safari. Including iOS features such as push notifications, Core Location, and sharing do not provide a robust enough experience to be appropriate for the App Store.
Next Steps
@iMaz1n
iMaz1n / twitter-remove-retweets.js
Created March 3, 2022 07:07 — forked from antlionguard/twitter-remove-retweets.js
With this script, you can remove all retweets you are retweeted on Twitter.
const timer = ms => new Promise(res => setTimeout(res, ms));
// Unretweet normally
const unretweetTweet = async (tweet) => {
await tweet.querySelector('div[data-testid="unretweet"]').click();
await timer(250);
await document.querySelector('div[data-testid="unretweetConfirm"]').click();
console.log('****// Unretweeted Successfully //****')
}