Skip to content

Instantly share code, notes, and snippets.

View oshybystyi's full-sized avatar

Oleksandr Shybystyi oshybystyi

  • Ukraine, Lutsk
View GitHub Profile
@oshybystyi
oshybystyi / TestModel.js
Last active March 31, 2018 11:08
Checking how to know old attribute values in mongoose middleware
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var testModelSchema = new Schema({
name: String,
ready: {type: Boolean, default: false}
});
testModelSchema.pre('init', function(done) {
console.log('------------------');
@oshybystyi
oshybystyi / git-auto-status.plugin.zsh
Created June 10, 2015 10:28
OhMyZsh plugin to display git status after a bunch of predefined git commands
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi [email protected]
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
# zsh
EMOJI=(๐Ÿ’ฉ ๐Ÿฆ ๐Ÿš€ ๐Ÿž ๐ŸŽจ ๐Ÿ• ๐Ÿญ ๐Ÿ‘ฝ โ˜•๏ธ ๐Ÿ”ฌ ๐Ÿ’€ ๐Ÿท ๐Ÿผ ๐Ÿถ ๐Ÿธ ๐Ÿง ๐Ÿณ ๐Ÿ” ๐Ÿฃ ๐Ÿป ๐Ÿ”ฎ ๐Ÿ’ฐ ๐Ÿ’Ž ๐Ÿ’พ ๐Ÿ’œ ๐Ÿช ๐ŸŒž ๐ŸŒ ๐ŸŒ ๐Ÿ“ ๐Ÿ„ )
function random_emoji {
echo -n "$EMOJI[$RANDOM%$#EMOJI+1]"
}
PROMPT="$(random_emoji) "
RPROMPT='%c'
@oshybystyi
oshybystyi / bootstrap.js
Last active May 30, 2017 01:12
Load default preferences for firefox bootstrap (restartless) addons
/**
* Default addon bootstrap file
* full example can be found here https://github.com/oshybystyi/FireX-Pixel-Perfect/blob/issue-5-make-addon-restartless/bootstrap.js
*/
const defaultPreferencesLoaderLink = 'chrome://<addon-alias/<path-to>/defaultPreferencesLoader.jsm';
function startup(data) {
/** some code here ... **/
loadDefaultPreferences(data.installPath);