Skip to content

Instantly share code, notes, and snippets.

View gnrlbzik's full-sized avatar
🚀

Alesei N gnrlbzik

🚀
View GitHub Profile
//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 / 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);
// 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'})
{
"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",