Skip to content

Instantly share code, notes, and snippets.

View drinchev's full-sized avatar
©️
...

Ivan Drinchev drinchev

©️
...
View GitHub Profile
# LS_COLORS
# Maintainers: Magnus Woldrich <m@japh.se>,
# Ryan Delaney <ryan.delaney@gmail.com> OpenGPG: 0D98863B4E1D07B6
# URL: https://github.com/trapd00r/LS_COLORS
# Version: 0.254
# Updated: Sun Jun 1 14:36:30 PDT 2014
#
# This is a collection of extension:color mappings, suitable to use as your
# LS_COLORS environment variable. Most of them use the extended color map,
# described in the ECMA-48 document; in other words, you'll need a terminal
@drinchev
drinchev / drinchev.zsh-theme
Created September 28, 2023 08:47
Theme for zsh
# Git: branch/detached head, dirty status
prompt_git() {
local ref dirty mode repo_path
repo_path=$(git rev-parse --git-dir 2>/dev/null)
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
dirty=$(parse_git_dirty)
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
# if [[ -n $dirty ]]; then
@drinchev
drinchev / candle-sticks.ts
Last active September 20, 2023 09:53
Candle Stick In Terminal
const UP_MOVE = 1;
const DOWN_MOVE = -1;
const SYMBOL_STICK = "│";
const SYMBOL_CANDLE = "┃";
const SYMBOL_HALF_TOP = "╽";
const SYMBOL_HALF_BOTTOM = "╿";
const SYMBOL_HALF_CANDLE_TOP = "╻";
const SYMBOL_HALF_CANDLE_BOTTOM = "╹";
const SYMBOL_HALF_STICK_TOP = "╷";
const SYMBOL_HALF_STICK_BOTTOM = "╵";
@drinchev
drinchev / gist:9957a01d1db60c3cf4cdeb8a17e20fd1
Created December 29, 2018 20:25
stack-overflow/53972854
const mongoose = require( "mongoose" );
mongoose.connect( "mongodb://localhost:27017/test", { useNewUrlParser : true } );
const Item = mongoose.model( "Item", {
inv : {
type : Object,
default : {}
}
} );

Keybase proof

I hereby claim:

  • I am drinchev on github.
  • I am drinchev (https://keybase.io/drinchev) on keybase.
  • I have a public key ASCLG_6Zyq76n6CRWfaiwT7IqJjLv5B3AyrSHbfiPUF1uAo

To claim this, I am signing this object:

Verifying that +drinchev is my blockchain ID. https://onename.com/drinchev
<!DOCTYPE html>
<html>
<head>
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<script src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
<script>
tinymce.init({
selector:'#editor',
min_height : 300,
@drinchev
drinchev / mac
Created May 28, 2013 13:16
Disable the Window Shadow on Screen Shots in Mac OS X
#
# Disable MAC OS X screenshot ( Shift + Cmd + 4, Space ) shadow
#
# ref: http://osxdaily.com/2011/05/23/disable-shadow-screen-shots-mac/
#
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
# To revert back to default use :
@drinchev
drinchev / gist:4709257
Created February 4, 2013 20:05
Basic socket.io + express app
var express = require('express'),
app = express(),
http = require('http'),
server = http.createServer(app),
io = require('socket.io').listen(server);
app.get('/', function(req, res) {
res.send('<!doctype html> \
<html> \
<head><meta charset="utf-8"></head> \
@drinchev
drinchev / app.js
Created February 4, 2013 19:41
socket.io + expressJS + cookies authorization Just run this file with the dependencies : express , cookie , connect , socket.io `npm i [dependency]`
var express = require('express'),
app = express(),
http = require('http'),
server = http.createServer(app),
users = 0,
MemoryStore = express.session.MemoryStore,
sessionStore = new MemoryStore(),
parseCookie = require('cookie').parse,
utils = require('connect').utils,
io = require('socket.io').listen(server);