Skip to content

Instantly share code, notes, and snippets.

View mhamzas's full-sized avatar

Hamza Siddiqui mhamzas

View GitHub Profile
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
<aura:attribute name="notifications" type="List"/>
<aura:attribute name="isMuted" type="Boolean" default="false"/>
<aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
<aura:registerEvent name="toastEvent" type="force:showToast"/>
<div class="container">
<!-- Header -->
<div class="slds-p-around_x-small slds-border_bottom slds-theme_shade">
<div class="slds-grid slds-grid_align-spread slds-grid_vertical-align-center">
<div>
@mhamzas
mhamzas / Balsamiq mockups Serial
Last active April 30, 2020 15:06
Only working version is 3.x.x
Organization name: [email protected]
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8k
Download : https://balsamiq.com/wireframes/desktop/archives/?prefix=obsolete/mockups-desktop/3.5.17/
@mhamzas
mhamzas / backup.sh
Created May 3, 2020 16:24 — forked from sutlxwhx/backup.sh
Backup all your MySQL / MariaDB databases with rclone
#!/usr/bin/env bash
# To run this script you need to install https://rclone.org/ first
# Use current date and time for future backup folder name
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
# Declare the directory where the temporary backup files will be stored
BACKUP_DIR="/backup/$TIMESTAMP/mysql"
# State the username for your MySQL / MariaDB instace that can access the neccessary databases
MYSQL_USER=""
# Point this script to mysql executable file
MYSQL=/usr/bin/mysql
@mhamzas
mhamzas / mysqlDBbackup.sh
Created May 3, 2020 16:29
Backup Single Mysql/MariaDB with rclone
#!/usr/bin/env bash
# To run this script you need to install https://rclone.org/ first
# Use current date and time for future backup folder name
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
# Declare the directory where the temporary backup files will be stored
BACKUP_DIR="/backup/"
# Declare the directory where the backup files will be stored in Remote
BACKUP_DIR_REMOTE="/backup/"
# State the username for your MySQL / MariaDB instace that can access the neccessary databases
MYSQL_USER=""
@mhamzas
mhamzas / Padavan Config for HMA
Last active March 31, 2022 17:09
HMA OPENVPN on Padavan
https://gyazo.com/c767ad65c71fdb62d4c11845189b2d3e
@mhamzas
mhamzas / Workarounds for Netflix and the blocking of IPv6 tunnels.md Prevent proxy/VPN streaming error messages from Netflix when using an IPv6 tunnelf

Workarounds for Netflix and the blocking of IPv6 tunnels

The dreaded "You seem to be using an unblocker or proxy." error message. Cool story bro.

This gist was essentially created out of my own rant about Netflix being hostile to IPv6 tunnel services since June 2016. You are welcome to read my opinion on the matter, this is the more technical side to the issue and how to combat it within your own network.

Since I wrote this, various GitHub users have contributed their thoughts and ideas which has been incorporated into this gist. Thank you to everyone who have contributed their own methods and implementations.

The problem

Netflix now treats IPv6 tunnel brokers (such as Hurricane Electric) as proxy servers. A while ago it became apparent to users and Netflix that somewhat by accident, IPv6 tunnel users were being served content outside of their geolocation because of the way Netflix was identifying the tunnel servi

@mhamzas
mhamzas / IntervalJS.cmp
Last active May 19, 2020 20:34
Calling Apex method at regular interval from Lightning Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" controller="RefreshContactCounter" access="global" >
<aura:attribute name="recordId" type="Id"></aura:attribute>
<aura:attribute name="pollId" type="String"></aura:attribute>
<lightning:button variant="brand" label="Subscribe" title="Subscribe" onclick="{!c.init}" />
<lightning:button variant="brand-outline" label="Stop" title="Stop" onclick="{!c.cancelSubscribe}" />
</aura:component>
({
loanComplete: function (component, event, helper) {
if (event.getParam('status') === "ERROR") {
console.log('Error');
}
if (event.getParam('status') === "FINISHED") {
console.log('Finish Started');
/// Hide Flow Screen
$A.util.addClass(component.find("loanflow"), "slds-hide");
$A.util.addClass(component.find("flow"), "slds-hide");
@mhamzas
mhamzas / gist:4907848214980ed5bbeab8caa2ea86e2
Created May 21, 2020 19:30
JS - Split String without empty elements
str.split(' ').filter(function(i){return i})
@mhamzas
mhamzas / childComponentWithMethod.cmp
Created June 17, 2020 15:10 — forked from pozil/childComponentWithMethod.cmp
Lightning - Passing data down the component hierarchy via a method
<aura:component >
<aura:method name="myMethod" action="{!c.executeMyMethod}">
<aura:attribute name="param1" type="String"/>
<aura:attribute name="param2" type="String"/>
</aura:method>
</aura:component>