This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sorting an array order by frequency of occurence and removing Duplicates in javascript | |
* @param {array} array An array to sort | |
* @returns {array} array of item order by frequency | |
**/ | |
function sortByFrequencyRemoveDuplicates(array) { | |
var frequency = {}; | |
var newArr = []; | |
array.forEach(function(value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install dependencies | |
apt-get install libsqlite3-dev ruby1.9.1-dev -y | |
# Few extra dependencies if you version is 1.9 an lower | |
sudo gem install mime-types --version "< 3" | |
# Install the gem | |
gem install --conservative mailcatcher | |
#ignore any errors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Feedback = Backbone.Model.extend({ | |
url: '/feedback', | |
defaults: { | |
'email': '', | |
'website': '', | |
'feedback': '' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Allow Vim-only settings even if they break vi keybindings. | |
set nocompatible | |
" Enable filetype detection. | |
filetype plugin indent on | |
" Load plugins with Pathogen | |
execute pathogen#infect() | |
execute pathogen#incubate() | |
execute pathogen#helptags() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Allow Vim-only settings even if they break vi keybindings. | |
set nocompatible | |
" Enable filetype detection. | |
filetype plugin indent on | |
" Load plugins with Pathogen | |
execute pathogen#infect() | |
execute pathogen#incubate() | |
execute pathogen#helptags() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Reload a varnish config | |
# Author: Kristian Lyngstol | |
FILE="/etc/varnish/ugc.vcl" | |
# Hostname and management port | |
# (defined in /etc/default/varnish or on startup) | |
HOSTPORT="localhost:6082" | |
NOW=`date +%s` |