A collection of useful tips in bash.
command >/dev/null # Silent all output.
/// <summary> | |
/// Unregisters all delegates from an EventHandler. | |
/// </summary> | |
/// <param name="eventHandler">EventHandler to clear.</param> | |
public static void UnregisterAllDelegates(ref EventHandler eventHandler) | |
{ | |
// Cancel if already cleared. | |
if (eventHandler == null) | |
return; |
# Switch between stable and beta version of Xcode in the same folder. | |
# Useful when you need to work with Xcode beta to try the latest APIs | |
# and Xcode stable for production on the same machine. | |
# Folder where Xcode resides. | |
FOLDER="/Applications" | |
# Names of the different versions of Xcode. | |
APP="$FOLDER/Xcode.app/" | |
APP_BETA="$FOLDER/Xcode-beta.app/" |
import sys | |
from time import sleep | |
if __name__ == "__main__": | |
i = 0 | |
x = 0 | |
d = 1 | |
print('\033[36m') | |
while 1: |
#!/bin/bash | |
while : | |
do | |
play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 0.25 0.1 | |
play -n -c1 synth sin %-12 sin %-9 sin %-0 sin %-2 fade h 0.1 0.25 0.1 | |
play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 0.25 0.1 | |
play -n -c1 synth sin %-12 sin %-9 sin %-0 sin %-2 fade h 0.1 0.25 0.1 | |
play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 0.25 0.1 | |
play -n -c1 synth sin %-12 sin %-9 sin %-0 sin %-2 fade h 0.1 0.25 0.1 |
#!/bin/bash | |
# | |
# Create a virtual disk on RAM with a given name and size. | |
# To remove it, just unmount it in Finder. | |
# | |
# Usage: ram.sh <name> <size in MB> | |
# | |
function usage() { | |
echo "$0 <name> <size in MB>" |
/* Remove Medium.com's modal. */ | |
.ar.as.dx.nn.no.np.nq.nr.ns.m.n.nt.o.p.nu { | |
display:none; | |
} |
#/usr/bin/env bash | |
# | |
# rename.sh | |
# | |
# Replace any occurency of "<source>" to "<target>" in a given <directory>. | |
# This apply to (sub)folders/files name and files content. | |
# Think about it like a refactoring function. | |
# | |
# Usage: rename.sh <source> <target> <directory> | |
# |
/* | |
Create a new stylesheet for "instagram.com" with the Stylus* extension and | |
add the following lines to it to remove their goddamn popup. | |
* Install it from there: | |
Firefox: https://addons.mozilla.org/en/firefox/addon/styl-us/ | |
Chrome: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne | |
*/ | |
body { overflow: unset !important; } | |
.RnEpo { display: none; } |
/** | |
* Custom wrapper using the Fetch API. | |
*/ | |
const Fetch = { | |
async get (url) { return this.request(url, 'GET'); }, | |
async post (url, data={}) { return this.request(url, 'POST', data); }, | |
/** | |
* Do a request. |