Skip to content

Instantly share code, notes, and snippets.

View pasim's full-sized avatar

pasim pasim

View GitHub Profile
@pasim
pasim / sortByFrequencyRemoveDuplicates.ts
Last active February 10, 2021 18:47 — forked from niteshpsit1/gist:c90b3336ee639c89ae13b98825c9d9ca
Sorting an array order by frequency of apperance and removing duplicates in javascript and TypeScript.
/**
* 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) {
@pasim
pasim / setup_mailcatcher.sh
Last active April 22, 2016 13:09 — forked from conroyp/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 14.04
#!/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
var Feedback = Backbone.Model.extend({
url: '/feedback',
defaults: {
'email': '',
'website': '',
'feedback': ''
},
@pasim
pasim / .vimrc
Created September 7, 2013 07:46 — forked from rteijeiro/.vimrc
Vim config for Drupal project development
" 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()
@pasim
pasim / .vimrc
Created August 22, 2013 15:23 — forked from rteijeiro/.vimrc
Vim config for Drupal project development
" 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()
#!/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`