Skip to content

Instantly share code, notes, and snippets.

View sasha7's full-sized avatar

Sasa Macakanja sasha7

View GitHub Profile
@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 / 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 / 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 / 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
#!/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 / gist:4fc7e3094c35bbcddfccad85b006c3de
Created November 14, 2017 23:31 — forked from tinifni/gist:3756796
Remember what you've done since your last standup
# zsh script checks first if there were any commits done
# by author yesterday. If there were, return those. If
# there weren't, look for all commits since last Friday
# at midnight as it may have been a weekend.
#
# Use your name in the --author for all commands
gitstandup() {
if [ -z "$(git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=yesterday.midnight)" ]; then
git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=last.friday.midnight;
{
"ecmaVersion": 6,
"libs": ["browser"],
"loadEagerly": [
"app/**/*.js"
],
"plugins": {
"doc_comment": {
"fullDocs": true
},
@sasha7
sasha7 / spacemacs-cheshe.md
Created February 9, 2018 01:44 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@sasha7
sasha7 / json_postgres.js
Created May 27, 2018 21:33 — forked from lucdew/json_postgres.js
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
@sasha7
sasha7 / fix-homebrew-npm.md
Last active August 14, 2018 21:22 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.