Skip to content

Instantly share code, notes, and snippets.

View sasha7's full-sized avatar

Sasa Macakanja sasha7

View GitHub Profile
#!/usr/bin/env ruby
# Colorize string
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
end
class Colors
@sasha7
sasha7 / tmux-cheatsheet.markdown
Last active May 28, 2019 09:33 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sasha7
sasha7 / zsh theme
Created May 25, 2017 00:25 — forked from hub23/zsh theme
Custom ZSH Theme
# user colors
if [ $UID -eq 0 ]; then USERCOLOR="red"; else USERCOLOR="green"; fi
# box name
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
# workdir
local current_dir='${PWD/#$HOME/~}'
@sasha7
sasha7 / lazylibs.service.ts
Created May 10, 2017 23:50 — forked from JohannesRudolph/lazylibs.service.ts
Angular lazy library loader
import { Injectable, Inject } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { ReplaySubject } from 'rxjs/ReplaySubject';
import { DOCUMENT } from '@angular/platform-browser';
@Injectable()
export class LazylibsService {
private chartJs?: ReplaySubject<any>;
@sasha7
sasha7 / aprompt.png
Created February 20, 2017 13:30 — forked from mislav/aprompt.png
My zsh prompt. No oh-my-zsh needed
aprompt.png
@sasha7
sasha7 / sublime-text-3-setup.md
Created February 15, 2017 14:25 — forked from ijy/sublime-text-3-setup.md
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following:
@sasha7
sasha7 / goto-sublime
Last active February 15, 2017 14:52 — forked from kendellfab/goto-sublime
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["super"],
"press_command": "drag_select",
@sasha7
sasha7 / gitflow-breakdown.md
Created February 13, 2017 01:22 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@sasha7
sasha7 / flash-app.js
Created January 28, 2017 00:38 — forked from brianmacarthur/flash-app.js
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@sasha7
sasha7 / readme.md
Created January 23, 2017 12:26 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser