Skip to content

Instantly share code, notes, and snippets.

View gnrlbzik's full-sized avatar
🚀

Alesei N gnrlbzik

🚀
View GitHub Profile

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.
//SASS/COMPASS formatting i would like to have for organizational purpose.
#dashboard-content {
/*rule:value;*/
&.my-account-v2 {
/*rule:value;*/
.page {
/*rule:value;*/
.inner {
/*rule:value;*/
}
@gnrlbzik
gnrlbzik / gist:969655
Created May 12, 2011 23:11
WEBRick server script
# WEBRick server code
# - reading file specified per path, servlet then dynamically loads file and erb interprets the code inside of the .rhtml.
require 'webrick'
include WEBrick
require 'erb'
WEBrick::HTTPUtils::DefaultMimeTypes['rhtml'] = 'text/html'
@gnrlbzik
gnrlbzik / gist:971263
Created May 13, 2011 20:33
ruby method issue
# webrick.rb
require 'webrick'
WEBrick::HTTPUtils::DefaultMimeTypes['rhtml'] = 'text/html'
server = WEBrick::HTTPServer.new :Port => 3000, :DocumentRoot => Dir.pwd
trap 'INT' do server.shutdown end
server.start
@gnrlbzik
gnrlbzik / gist:977887
Created May 18, 2011 02:35
Sinatra Local Server for ruby script testing
# http://localhost:4567/
require 'rubygems'
require 'sinatra'
get("/*.rb") do
`ruby #{request.path_info.slice(1..-1)}`
end
@gnrlbzik
gnrlbzik / gist:987522
Created May 23, 2011 20:25
Sinatra App
# Project Folder Stracture
# ===============================
/mirteam-site/config.ru
/mirteam-site/favicon.ico
/mirteam-site/mirteam-sinatra-app.rb
/mirteam-site/README.markdown
# config.ru
@gnrlbzik
gnrlbzik / gist:1140631
Created August 11, 2011 20:15
ui autocomplete - Stack Overflow Question
var serverSearchField = $("#txtSearchServer");
var listServers = [];
serverSearchField.autocomplete({
source: listServers
});
serverSearchField.keyup(function (event) {
$.ajax({
url: 'edit/EditService.svc/SearchServers',
@gnrlbzik
gnrlbzik / gist:4025253
Created November 6, 2012 15:02 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@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"
@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);