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
@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

@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);
@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" \
@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---------
@mashpie
mashpie / i18n-express4-cookie-example.js
Last active August 12, 2021 15:48
i18n-express4-cookie-example
@soheilhy
soheilhy / nginxproxy.md
Last active April 11, 2025 06:29
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

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 19, 2025 04:48
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@nabucosound
nabucosound / heroku_env_copy.sh
Created December 30, 2013 12:40
Script to copy environment variables from an existing heroku app to another one
#!/bin/bash
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
set -e
sourceApp="$1"
targetApp="$2"
while read key value; do
@willurd
willurd / web-servers.md
Last active April 20, 2025 00:42
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@orenbenkiki
orenbenkiki / enhanced_extension.ex
Last active September 12, 2024 04:08
Elixir module inheritance
defmodule Extension do
defmacro extends(module) do
# As above...
end
defmacro implements(module, protocol: protocol) do
quote do
defimpl unquote(protocol), for: unquote(module) do
import Extension