Skip to content

Instantly share code, notes, and snippets.

View nicohq's full-sized avatar

Nico nicohq

  • Kyiv, Ukraine
  • 17:22 (UTC +02:00)
View GitHub Profile
@nicohq
nicohq / Rollup conf
Created May 25, 2017 08:08
Rollup config
import builtins from 'rollup-plugin-node-builtins';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';
import { minify } from 'uglify-js-harmony';
const isProd = process.env.NODE_ENV === 'prod';
export default {
entry: 'app.js',
@nicohq
nicohq / git tips.md
Last active September 20, 2016 08:16
Git tips

To delete all local branches that are already merged into the currently checked out branch exclude master, stage branches
git branch --merged | egrep -v "(^\*|master|stage)" | xargs git branch -d

See how many lines of code you have written today
git diff --shortstat "@{0 day ago}"

Uncommit something (3 commit back)
git reset --soft HEAD~3

{
"name": "browserify_babelify",
"version": "1.1.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "watchify src/app.js -d -o bundle.js -v [ babelify --presets [es2015] ]",
"build": "browserify src/app.js -t [ babelify --presets es2015 ] | uglifyjs -mco bundle.js"
},
@nicohq
nicohq / Kottans.md
Last active August 29, 2015 14:18
Kottans.Fin
@nicohq
nicohq / nodejs-vm.md
Last active August 29, 2015 14:17
Nodejs update

Fortunately there is a very easy way of managing your node version, using the Node binary manager module ‘n’.

1.Check your current version of Node.
$node -v v0.6.12
2.Clear your npm cache
sudo npm cache clean -f
3.Install ‘n’
sudo npm install -g n 4.Upgrade to a later version (this step can take a while) You can specify a particular version like so:
sudo n 0.8.11

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nicohq
nicohq / Git_logs
Last active August 29, 2015 14:11
Git log
git log --format='%Cred%h%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset%C(yellow)%d%Creset' --no-merges
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@nicohq
nicohq / Install_tmux
Last active August 29, 2015 14:08 — forked from simme/Install_tmux
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# Enable mouse support in ~/.tmux.conf
@nicohq
nicohq / gitignore
Created April 21, 2014 17:52
.gitignore
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
@mixin all-retina-sprites($map, $dimensions: false){
$base-class: sprite-map-name($map);
.#{$base-class}-retina-sprite{
background: sprite-url($map) no-repeat;
@include background-size(ceil(image-width(sprite-path($map)) / 2) auto);
}
@each $sprite in sprite-names($map){
.#{$base-class}-#{$sprite}{