Skip to content

Instantly share code, notes, and snippets.

View vicneanschi's full-sized avatar

Valeri Vicneanschi vicneanschi

  • Montreal, Canada
View GitHub Profile
@vicneanschi
vicneanschi / nvmuse.md
Created November 17, 2021 21:22 — forked from danpetitt/nvmuse.md
Using nvmrc on Windows

Using nvmrc on Windows

Unfortunately nvm use on Windows does not change the node version to that specified in the .nvmrc file as its not supported on nvm for Windows: coreybutler/nvm-windows#388

So the easiest solution to this is to use a simple Powershell command that performs an approximation of the command as follows: nvm use $(Get-Content .nvmrc).replace( 'v', '' );

However, thats a bit awkward and we can do a bit more so instead, we can create an 'alias' to a function that calls the command instead:

function callnvm() {
@vicneanschi
vicneanschi / 1p
Created February 14, 2020 03:22 — forked from justinline/1password clipboard
1password command line clipboard copying
# Short alias to allow automated copying of the 1password cli tool command 'op get somewebsite | jq ...' and then a timed clear on the gnome clipboard
# TODO: specify designation as an argument and maybe a command to open the website in chrome
pass=$(op get item $1 | jq -r '.details.fields[] | select(.designation=="password").value')
if [ -n "$pass" ]
then
echo $pass | xclip -selection clipboard
echo "Password was copied - clipboard will be wiped in 15 seconds"
sleep 15
@vicneanschi
vicneanschi / describe.groovy
Last active December 20, 2017 21:21 — forked from robertdale/describe.groovy
JanusGraph Schema Describe Command
// This can be imported via ./bin/gremlin.sh -i describe.groovy
// A variable 'graph' must be defined with a JanusGraph graph
// Run it as a plugin command ':schema'
// :schema describe
//
import org.janusgraph.graphdb.database.management.MgmtLogType
import org.codehaus.groovy.tools.shell.Groovysh
import org.codehaus.groovy.tools.shell.CommandSupport
@vicneanschi
vicneanschi / eventemitter.js
Last active August 26, 2015 13:28 — forked from liamcurry/eventemitter.js
Simple Client-side EventEmitter implementation
function EventEmitter() {}
EventEmitter.prototype.on =
EventEmitter.prototype.addListener = function (event, callback) {
this._events = this._events || {};
this._events[event] = this._events[event] || [];
this._events[event].push(callback);
return this;
};