Skip to content

Instantly share code, notes, and snippets.

View gnrlbzik's full-sized avatar
🚀

Alesei N gnrlbzik

🚀
View GitHub Profile
@gnrlbzik
gnrlbzik / iterm2-solarized.md
Created January 25, 2019 02:47 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@gnrlbzik
gnrlbzik / nodemon-babel-node-in-package.json
Last active June 14, 2018 04:27
yarn package scripts use ./node_modules/.bin for nodemon and babel-node
// to resolve nodemon and babel-node in cli
{
"scripts": {
"server:watch": "./node_modules/.bin/nodemon ./app/server/index.js --exec ./node_modules/.bin/babel-node"
}
}
@gnrlbzik
gnrlbzik / .bash_profile
Created November 20, 2015 00:39
java version switch
useJava () {
JDK6="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"
JDK7="/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home"
JDK8="/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home"
case "$1" in
"6")
echo "Using JDK6: ${JDK6}"
export JAVA_HOME="{$JDK6}/bin"

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
Hello there.
@gnrlbzik
gnrlbzik / server.js
Created August 5, 2013 16:19
Wild card serving static website.
var express = require('express');
var http = require('http');
var path = require('path');
var app = express();
app.get("/css/*",function(req,res){
res.sendfile('app'+req.path);
});
app.get("/js/*",function(req,res){
res.sendfile('app'+req.path);
// Run with: grunt switchwatch:target1:target2 to only watch those targets
grunt.registerTask('switchwatch', function() {
var targets = Array.prototype.slice.call(arguments, 0);
Object.keys(grunt.config('watch')).filter(function(target) {
return !(grunt.util._.indexOf(targets, target) !== -1);
}).forEach(function(target) {
grunt.log.writeln('Ignoring ' + target + '...');
grunt.config(['watch', target], {files: []});
});
grunt.task.run('watch');
{
"use_simple_full_screen": false,
// calculates indentation automatically when pressing enter
"auto_indent": true,
// sets the colors used within the text area (default)
// see https://github.com/olivierlacan/monokaim to download
// the customized Monokai I use.
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme",
// Create registry
// order is wrong
$routeProvider
.when('/create', {templateUrl: 'partials/guide/create-registry.html', controller: 'create-registry'})
.when('/create/:type', {templateUrl: 'partials/guide/create-registry.html', controller: 'create-registry'})
.otherwise({redirectTo: '/create'});
// should be
$routeProvider
.when('/create/:type', {templateUrl: 'partials/guide/create-registry.html', controller: 'create-registry'})
@gnrlbzik
gnrlbzik / round-up-for-range.js
Last active December 14, 2015 14:49
Round up number for range in JS
var max = 128,
maxLength = max.toString().length > 1 ? max.toString().length : 2,
maxRoundedUp = Math.ceil(max/Math.pow(10,maxLength) * 10) * Math.pow(10,maxLength-1);