Skip to content

Instantly share code, notes, and snippets.

View M-Dahab's full-sized avatar
🔥
Coding..

Mohammad Dahab M-Dahab

🔥
Coding..
View GitHub Profile
@soheilhy
soheilhy / nginxproxy.md
Last active August 12, 2026 20:00
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@mashpie
mashpie / i18n-express4-cookie-example.js
Last active August 12, 2021 15:48
i18n-express4-cookie-example
@jacobsalmela
jacobsalmela / nc-reverse-shell.sh
Created August 13, 2014 12:37
(OS X) Reverse shell via netcat
#!/bin/bash
#----------AUTHOR------------
# Jacob Salmela
# 9 April 2013
#---------DESCRIPTION--------
# Serves up an unencrypted, reverse-shell when the -e option is unavailable
# Much less reliable (command lag), but useful in a pinch
#----------FUNCTIONS---------
@richard512
richard512 / sms.sh
Last active November 16, 2021 20:44
Send SMS Text Messages via ADB Android Debugger on Linux
#/bin/bash
phonenum="+10000000000"
smsbody="hello world"
# use adb to say "start the app we use for SMS"
# with the following information
adb shell am start \
-a android.intent.action.SENDTO \
-d sms:"$phonenum" \
@Melvillian
Melvillian / gist:17d10138f616893eeb88525987c6f7d5
Last active August 12, 2023 12:05
Solutions to "move_semantics2.rs" of Rustlings
/// given this uncompilable code
pub fn main() {
let vec0 = Vec::new();
let mut vec1 = fill_vec(vec0);
// Do not change the following line!
println!("{} has length {} content `{:?}`", "vec0", vec0.len(), vec0);
vec1.push(88);
@larsxschneider
larsxschneider / readme.md
Last active October 10, 2024 16:49
Bookmarklet - Close all files in PR

Installation

Make a new bookmark in your browser. Set the name to Close all PR files (or something else you like) and set the URL to:

javascript:void((function(d){d.querySelectorAll('div:not(.Details--on) > div.file-header > div.file-actions > button').forEach(function(x){x.click()});})(document));

Usage

@marteinn
marteinn / instructions.md
Last active October 13, 2024 21:42
This is a Phoenix + React-Create-App integration with very small footprint
  1. Begin with scaffolding a create-react-app, then update your package.json build script (replace DIR_TO_PHX_APP with the path to your phoenix app)
"build": "react-scripts build && rm -rf DIR_TO_PHX_APP/priv/static/build && mv build DIR_TO_PHX_APP/priv/static/build",

This will move your prod build files to DIR_TO_PHX_APP/priv/static/build on build

  1. Run npm run build
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active September 10, 2026 16:27
crack activate Office on mac with license file
@bradtraversy
bradtraversy / myscript.sh
Last active June 4, 2026 19:39
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@tanaikech
tanaikech / submit.md
Last active May 20, 2025 20:41
Adding Query Parameters to URL using Google Apps Script

Adding Query Parameters to URL using Google Apps Script

Updated on February 5, 2024

This is for adding the query parameters to the URL. These scripts can be also used for Javascript. When I created an endpoint with some query parameters, I had used the scripts of various patterns every time. Today, I prepared this sample script to unify them. If this is also useful for you, I'm glad.

Sample script (With V8 runtime):

String.prototype.addQuery = function (obj) {