Skip to content

Instantly share code, notes, and snippets.

View MrMohebi's full-sized avatar
📚
Learning

MMMohebi MrMohebi

📚
Learning
View GitHub Profile
@frolleks
frolleks / DECOMPILING_AN_ELECTRON_APP.md
Last active June 20, 2024 12:15
How to decompile an Electron app

Let me tell you how easy it is to decompile an Electron app (that's closed source).

Prerequisites

Decompilation

First of all, you find the install path of your Electron app. If you found it, find the resources folder. If you found it, you'll have to install asar globally, by running:

@PeterRK
PeterRK / Simple Error Handling for Go 2.md
Last active June 29, 2022 06:33
Simple Error Handling for Go 2

Key Parts of Error Handling

val, err := function()
if err != nil {
	//handler codes...
}

Error handling consists of 3 key parts, trigger, handler and binding rule. In Go 1, trigger is if err != nil, handler is a piece of code in {}, and binding rule is obvious. Handler holds the control flow switch.

Actually, I donot think error handling in Go 1 has any functional problem. The only problem is repetition, especially repetition of triggers. Go 1 allows us to place trigger and assignment in one line, but that does not really solve the problem.

@alibo
alibo / iran-sanctions_blocker-sites.csv
Last active May 11, 2024 06:28
List of sites which block IPs come from Iran [UPDATING... (July 16, 2020)] #SANCTIONS
Title URI
Flurry by Yahoo https://dev.flurry.com/secure/signup.do
Google NikCollection https://dl.google.com/edgedl/photos/nikcollection-full-1.2.11.dmg
Bitbucket http://bitbucket.org/
SoftLayer http://softlayer.com/
VirtualBox http://download.virtualbox.org/virtualbox/5.0.16/VirtualBox-5.0.16-105871-OSX.dmg
Docker Hub https://hub.docker.com/
Oracle http://oracle.com/
Java http://java.com
Sun http://sun.com
@JProffitt71
JProffitt71 / s3cmdclearfiles
Created February 17, 2014 04:29
Uses s3cmd to manually remove files older than specified date (##d|m|y) in a specified bucket
#!/bin/bash
# Usage: ./s3cmdclearfiles "bucketname" "30d"
s3cmd ls s3://$1 | grep " DIR " -v | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -j -f "%Y-%m-%d %H:%M" "$createDate" +%s`
olderThan=`date -j -v-$2 +%s`
if [[ $createDate -lt $olderThan ]]