Skip to content

Instantly share code, notes, and snippets.

Avatar

Oleksandr Shybystyi oshybystyi

View GitHub Profile
@oshybystyi
oshybystyi / TestModel.js
Last active Mar 31, 2018
Checking how to know old attribute values in mongoose middleware
View TestModel.js
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 Jun 10, 2015
OhMyZsh plugin to display git status after a bunch of predefined git commands
View git-auto-status.plugin.zsh
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi oleksandr.shybystyi@gmail.com
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
View random-emoji.zsh-theme
# 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
Load default preferences for firefox bootstrap (restartless) addons
View bootstrap.js
/**
* 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);
You can’t perform that action at this time.