Skip to content

Instantly share code, notes, and snippets.

View MilanGrubnic70's full-sized avatar

Milan Grubnic MilanGrubnic70

View GitHub Profile
@MilanGrubnic70
MilanGrubnic70 / Snap.txt
Created April 23, 2017 20:34
Snap to Grid
Ctrl + Windows + arrow will snap window into grid positons.
@MilanGrubnic70
MilanGrubnic70 / embedded_Ruby.erb
Last active January 10, 2017 23:52
Embedded Ruby Shortcut Keybinding
// alt + r will get you <% _ %>
// shirt + alt + r will get you <%= _ %>
[
{ "keys": ["alt+r"],
"command": "insert_snippet",
"args": {
"contents": "<% ${1:}$SELECTION %> ${0}"
}
@MilanGrubnic70
MilanGrubnic70 / spec.rb
Created December 24, 2016 00:22
RSpec Refactored
require 'spec_helper'
describe "Static pages" do
let(:base_title) {"Ruby on Rails Tutorial Sample App"}
subject { page }
describe "Home page" do
@MilanGrubnic70
MilanGrubnic70 / forms_of_functions.js
Last active April 26, 2016 23:14
Functions: Declarative vs. Expression
Two Forms of Functions
// function declaration
function square(x) {
return x * x;
}
// function expression
var square = function(x) {
return x * x;
};
@MilanGrubnic70
MilanGrubnic70 / Directives
Created March 3, 2016 03:16
Angular Directives
app.directive('appInfo', function() {
return {
restrict: 'E',
scope: {
info: '='
},
templateUrl: 'js/directives/appInfo.html'
};
});
@MilanGrubnic70
MilanGrubnic70 / angularJS.md
Last active March 1, 2016 11:33
AngularJS Cheatsheet

AngularJS

ng = A**ng**ular

A module contains the different components of an AngularJS app

A controller manages the app's data

A directive tells that a module will live within the element, termed the application's scope. It defines the scope.

An expression displays values on the page

@MilanGrubnic70
MilanGrubnic70 / python_cheatsheet.txt
Last active February 17, 2016 02:40
Python Cheatsheet
python
exit()
python -m SimpleHTTPServer
localhost:8000
ctrl + c
@MilanGrubnic70
MilanGrubnic70 / sinatra_cheatsheet.md
Created February 14, 2016 00:43
Sinatra Cheatsheet

require 'rubygems' # Ruby 1.9 Ruby automatically loads RubyGems so you dont' need this line. require 'sinatra' require 'data_maper'

Sinatra will always look in the public/ folder for css files. Sinatra will alwasy look in the views/ folder for erb files.

@MilanGrubnic70
MilanGrubnic70 / Jasmine.Reference.txt
Last active January 24, 2016 05:05
Jasmine Cheat Sheet
Matchers Reference
toEqual checks for equality, not necessarily the same object.
toBe checks if two objects are the same.
toBeTruthy checks if a value is truthy (not just true).
toBeFalsy checks if a value is falsy (not just false).
toContain checks if a value is inside another.
toBeDefined checks if a value is defined.
toBeUndefined checks if a value is undefined.
toBeNull checks if a value is null.
@MilanGrubnic70
MilanGrubnic70 / jasmine.js
Created January 24, 2016 05:02
Jasmine: The Basic Structure of a Suite
describe("colors", function() {
describe("red", function() {
var red;
beforeEach(function() {
red = new Color("red");
});
afterEach(function() {
red = null;
});
it("has the correct value", function() {