Skip to content

Instantly share code, notes, and snippets.

[push]
default = current
[core]
trustctime = false
editor = vim
filemode = false
ignorecase = true
autocrlf = true
[color]
ui = true
@mdvorscak
mdvorscak / TestForm.js
Created August 30, 2015 22:14
A couple of functions to generate all types of form elements for testing purposes
function addOptionsToSelect($select, selectedItems){
var options = ['opt1', 'opt2', 'opt3'];
selectedItems = selectedItems || [];
var $currentOpt, currentOptionName, isSelected;
for(var i = 0, len = options.length; i < len; i++){
currentOptionName = options[i];
isSelected = selectedItems.indexOf(currentOptionName) > -1;
$currentOpt = $('<option>', {value: currentOptionName, selected: isSelected}).text(currentOptionName);
$select.append($currentOpt);
}
@mdvorscak
mdvorscak / IE8Shim
Created March 23, 2015 20:51
IE8 Shim
/*
* Shim for things not defined in IE8
*
*/
/*
Fix Event.preventDefault
*/
if (!Event.prototype.preventDefault) {
@mdvorscak
mdvorscak / ws-test-watcher
Created March 20, 2015 22:34
Webstorm test watcher
<?xml version="1.0" encoding="UTF-8"?>
<TaskOptions>
<TaskOptions>
<option name="arguments" value="C:\Users\mdvorscak\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js specs" />
<option name="checkSyntaxErrors" value="false" />
<option name="description" value="Automatically run jasmine tests using gulp" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="js" />
<option name="immediateSync" value="true" />
<option name="name" value="Auto Test runner" />
@mdvorscak
mdvorscak / WebStorm-setup
Last active August 29, 2015 14:17
WebStorm setup
Setting up WebStorm
1. Download + Install webstorm (https://www.jetbrains.com/webstorm/)
2. Download + Install NodeJS (https://nodejs.org/download/)
3. Download + Install Git (http://git-scm.com/downloads)
4. Install bower <npm i bower -g>
5. Add node and npm to your path:
a. see http://stackoverflow.com/questions/21732447/bower-command-not-found-windows
b. Paths to add "C:\Program Files (x86)\nodejs;C:\Users\{username}\AppData\Roaming\npm"
6. Restart WebStorm
@mdvorscak
mdvorscak / .vimrc
Created December 8, 2014 18:16
My VIMRC
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
@mdvorscak
mdvorscak / .bash_aliases
Last active August 29, 2015 14:11
My bash_aliases
alias ..='cdl ..'
alias ...='cdl ../..'
alias ....='cdl ../../..'
alias .....='cdl ../../../..'
alias .4='cdl ../../../../'
alias .5='cdl ../../../../..'
alias cim='vim'
alias root='sudo su'
alias v='vim'
alias la='ls -A'
@mdvorscak
mdvorscak / .bashrc
Created December 8, 2014 18:14
My BASHRC file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@mdvorscak
mdvorscak / designer.html
Created September 14, 2014 20:29
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../paper-button/paper-button.html">
@mdvorscak
mdvorscak / designer.html
Created September 14, 2014 20:20
designer
<link rel="import" href="../code-mirror/code-mirror.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;