Skip to content

Instantly share code, notes, and snippets.

@Gordin
Gordin / cd_for_windows_paths.sh
Last active May 1, 2024 14:32
If you put this in your .bashrc/.zshrc you will be able to use cd to Windows style paths. This is probably only useful for WSL users.
cd() {
# Check if no arguments to make just typing cd<Enter> work
# Also check if the first argument starts with a - and let cd handle it
if [ $# -eq 0 ] || [[ $1 == -* ]]
then
builtin cd $@
return
fi
# If path exists, just cd into it
# (also, using $* and not $@ makes it so you don't have to escape spaces any more)
@morrismukiri
morrismukiri / superset-admin-password-reset.sh
Created January 17, 2019 17:11
Apache Superset reset admin password
# activate the virtualenv
source /home/superset/.virtualenvs/superset/bin/activate
fabmanager reset-password --app superset --username admin --password enteryournewpassword
@tvaliasek
tvaliasek / main.js
Created June 5, 2018 20:09
electron axios stream download with progress
import {ipcMain} from 'electron'
const fs = require('fs')
const axios = require('axios')
/* ... */
ipcMain.on('downloadFile', function (event, data) {
const filePath = data.filePath
const item = data.item
@abritinthebay
abritinthebay / consoleColors.js
Last active May 22, 2024 20:57
The various escape codes you can use to color output to StdOut from Node JS
// Colors reference
// You can use the following as so:
// console.log(colorCode, data);
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`);
//
// ... and so on.
export const reset = "\x1b[0m"
export const bright = "\x1b[1m"
export const dim = "\x1b[2m"
@gartnera
gartnera / owa_keepalive.user.js
Created April 18, 2015 19:36
OWA Keep Alive
// ==UserScript==
// @name OWA Keep Alive
// @namespace agartner.com
// @include https://webmail.dsu.edu/owa/
// @version 1
// @grant none
// ==/UserScript==
setInterval(function(){onUserActivity()}, 600000)