Skip to content

Instantly share code, notes, and snippets.

View razzius's full-sized avatar
🍉

Razzi Abuissa razzius

🍉
View GitHub Profile
@tommyip
tommyip / venv.fish
Last active February 5, 2025 08:37
venv.fish - Automatically activate/deactivate virtualenv in fish shell
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
# * Handle virtualenvs that are not located in the root of a git directory.
function __auto_source_venv --on-variable PWD --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return
@Jatapiaro
Jatapiaro / qemu_ubuntu.md
Last active March 24, 2025 13:46
How to install QEMU on OSX and install an Ubuntu VM

Install QEMU on OSX

QEMU requires brew in OSX, so we need to install brew first.

Installing Brew

To install brew we need to have the developer tools enabled in our system. In order to install those tools, we have two options.

  1. Download Xcode form the AppStore
  2. In your terminal run the following command: xcode-select --install
@chapmanjacobd
chapmanjacobd / functions.fish
Last active August 8, 2020 10:35
fish functions
function sponge
/usr/bin/mkdir -p (dirname "$argv")
/usr/bin/sponge "$argv"
end
function tee
/usr/bin/mkdir -p (dirname "$argv")
/usr/bin/tee "$argv"
end
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@augustocdias
augustocdias / README.md
Last active September 17, 2019 21:40
Port forward Mac OS

Port Forwarding on Mac OS

In order to use the 80 or 443 ports on Mac OS without the need to start web server with root:

echo "rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080" | sudo pfctl -ef -

echo "rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443" | sudo pfctl -ef -

@william8th
william8th / .tmux.conf
Last active April 21, 2025 15:44
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@brianlovin
brianlovin / index.js
Last active October 29, 2019 20:04
Flow type function prop
// component
type AnotherType = {
data: {
id: string
}
}
type Props = {
aFunction: ({ id: string }) => AnotherType
}
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="https://fonts.googleapis.com/css?family=Stint+Ultra+Expanded" rel="stylesheet">
</head>
<body>
<p>Guess between: 1-15</p>
<input id= "one"><button id="first">Submit</button>
<div class="sup">You Guessed:</div><div id="word"></div>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<input><button>Submit</button>
<div>You guessed:</div><div id="word"></div>
<div id="WL"></div>
<div id="img"></div>
@zcmarine
zcmarine / remap_capslock.lua
Created March 28, 2017 15:35
Hammerspoon capslock remapping: tap to Escape, hold in chord for Control
-- Inspired by https://github.com/jasoncodes/dotfiles/blob/master/hammerspoon/control_escape.lua
-- You'll also have to install Karabiner Elements and map caps_lock to left_control there
len = function(t)
local length = 0
for k, v in pairs(t) do
length = length + 1
end
return length
end