Skip to content

Instantly share code, notes, and snippets.

@bxt
bxt / CD2-README.md
Last active April 9, 2017 19:57
Change shell directory to one of the open directories in other shells

cd2

cd2 is a tiny handy tool for working with multiple console windows at a time. When called, it displays a list of all working directories of your running terminals and lets you choose one by simply entering a number. If you enter nothing it takes you to the last entry listed which makes a good default behavior. This way, when you open a new terminal window and type cd2 and press enter twice you can continue in the same wd as your other bash.

Installing

To install for your user simply run:

@steve-ng
steve-ng / nginx.conf
Last active January 18, 2021 07:55
Nginx reverse proxy wss with ssl
server {
listen 443 ssl;
server_name xxx.xx.io
ssl on;
ssl_certificate /etc/asterisk/certs/xxx.io.pem;
ssl_certificate_key /etc/asterisk/certs/xxx.io.key;
ssl_session_timeout 5m;
@techeverri
techeverri / pushbullet-export-pushes.js
Last active July 16, 2021 14:29
Export all pushes from Pushbullet to a JSON
(function () {
'use strict';
var fs = require('fs');
var https = require('https');
var cursor = '';
var pushes = [];
@d13
d13 / gist:6423256
Created September 3, 2013 12:26
quick styling for exported Chrome bookmarks
<style>
* { margin:0; padding:0; }
body { margin:10px; }
dl { border:1px solid #eaeaea; padding:10px; margin-bottom:10px; }
/* dl > * { margin-left:10px; } */
dl h3 {
background:#f6f6f6;
padding:5px;
border:1px solid #eaeaea;
border-bottom:none;
@jamiemarsland
jamiemarsland / gist:5e618baeda2dd5199d4a
Created February 18, 2015 06:11
Remove WooThemes credit in Storefront footer
add_action( 'init', 'custom_remove_footer_credit', 10 );
function custom_remove_footer_credit () {
remove_action( 'storefront_footer', 'storefront_credit', 20 );
add_action( 'storefront_footer', 'custom_storefront_credit', 20 );
}
function custom_storefront_credit() {
?>
<div class="site-info">
@stefansundin
stefansundin / youtube-global-shortcuts.user.js
Last active May 5, 2022 17:27
Makes the YouTube shortcuts work even if the player is not focused. Install Greasemonkey/Tampermonkey first, then click [Raw] to install.
// ==UserScript==
// @name YouTube global shortcuts
// @namespace https://gist.github.com/stefansundin/
// @homepage https://gist.github.com/stefansundin/65e3d6db697636d8e7f1
// @downloadURL https://gist.github.com/stefansundin/65e3d6db697636d8e7f1/raw/youtube-global-shortcuts.user.js
// @version 1.1
// @author Stefan Sundin
// @description Makes the YouTube shortcuts work even if the player is not focused.
// @icon https://www.youtube.com/favicon.ico
// @match https://www.youtube.com/*
var attempts = 1;
function createWebSocket () {
var connection = new WebSocket();
connection.onopen = function () {
// reset the tries back to 1 since we have a new connection opened.
attempts = 1;
// ...Your app's logic...
@graceavery
graceavery / harryPotterAliases
Last active May 10, 2023 02:51
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'
@rordi
rordi / root-password-MariaDB-docker-compose.md
Last active January 23, 2024 15:36
Change root password in MariaDB Docker container running with docker-compose

Change root password in MariaDB Docker container running with docker-compose

Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:

entrypoint: mysqld_safe --skip-grant-tables --user=mysql

The start up the Docker Compose stack:

$> docker-compose up -d
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}