Skip to content

Instantly share code, notes, and snippets.

View shotgunner's full-sized avatar
👊

Mojtaba Kamyabi shotgunner

👊
View GitHub Profile
@vovimayhem
vovimayhem / install.sh
Last active November 20, 2023 22:33
Install on Linux Mint the latest version of JMeter that has the redirects behavior correct (2.9)
# Download the jmeter gzipped tarball to a temporary folder:
wget -O /tmp/jmeter.tgz http://archive.apache.org/dist/jmeter/binaries/apache-jmeter-2.9.tgz
# Extract to /usr/share
sudo tar -xzvf /tmp/jmeter.tgz -C /usr/share
# Edit the provided JMeter start script, changing the string '`dirname "$0"`' for '/usr/share/jmeter/bin':
sudo sed -i 's/`dirname "\$0"`/\/usr\/share\/apache-jmeter-2.9\/bin/g' /usr/share/apache-jmeter-2.9/bin/jmeter
# Generate the following symlinks:
@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

@mitchwongho
mitchwongho / Docker
Last active April 16, 2025 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@sloria
sloria / bobp-python.md
Last active April 27, 2025 07:06
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@marianposaceanu
marianposaceanu / linux_fun.md
Last active March 16, 2025 22:31
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@adamdb
adamdb / NERDTree Commands
Last active July 16, 2024 01:54
A list of useful NERDTree commands.
Use the natural Vim navigation keys hjkl to navigate the files.
Press o to open the file in a new buffer or open/close directory.
Press t to open the file in a new tab.
Press i to open the file in a new horizontal split.
Press s to open the file in a new vertical split.
Press p to go to parent directory.
Press r to refresh the current directory.
Press m to launch NERDTree menu inside Vim.
@iepathos
iepathos / Chrome and Django favicon fix
Last active October 4, 2022 17:06
Fix for Google Chrome favicon loading in Django. You may have noticed that Chrome has issues loading the appropriate favicon on Django if you have it in a different path other than just '/favicon.ico'. Firefox follows the template icon links no problem, but Chrome needs a little more help. I fixed this issue by adding this quick line to the urls…
#urls.py
from django.conf import settings
urlpatterns = patterns('',
url(r'^favicon.ico/$', lambda x: HttpResponseRedirect(settings.STATIC_URL+'ico/favicon.ico')), #google chrome favicon fix
)
# base.html
<link rel="shortcut icon" href="{{ STATIC_URL }}ico/favicon.ico">
@aponxi
aponxi / sql-mongo_comparison.md
Last active December 12, 2024 01:11
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@stephenmckinney
stephenmckinney / vim-command-t-bug.md
Created December 19, 2012 20:21
When NERDTree is open; opening a file in a vertical split resizes the buffer strangely

##To reproduce:

  • Open vim
  • Open NERDTree
  • Open a file
  • At this point Vim looks like this screenshot
  • Open Command-T, select a file, and press . This opens the file in a vertical split.
  • At this point Vim looks like this screenshot
  • Stay in that right-most vertical split.
  • Open Command-T, select a file, and press . This opens the file in the right-most vertical split (since it's active).
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example: