Skip to content

Instantly share code, notes, and snippets.

@aarjithn
aarjithn / env-config.js
Created Feb 8, 2017
Gulp environment config
View env-config.js
gulp.task('config', function () {
var parser = new xml2js.Parser();
var builder = new xml2js.Builder({
renderOpts: {
pretty: true,
indent: ' '
},
xmldec: {
version: '1.0',
encoding: 'utf-8'
@aarjithn
aarjithn / slidespage.html
Last active Mar 14, 2020
Sliding Segments Ionic v2
View slidespage.html
<ion-toolbar>
<ion-segment [(ngModel)]="selectedSegment" (ionChange)="onSegmentChanged($event)">
<ion-segment-button value="first">
First
</ion-segment-button>
<ion-segment-button value="second">
Second
</ion-segment-button>
<ion-segment-button value="third">
Third
@aarjithn
aarjithn / controller.js
Created Jun 26, 2016
Swiper Card Carousel in Ionic
View controller.js
controller('SwiperCtrl', function($scope, $stateParams) {
$scope.options = {
// loop: false,
// grabCursor: true,
// paginationHide: false,
// paginationClickable: false,
// direction: 'vertical',
// spaceBetween: 50,
effect: 'coverflow',
speed: 100,
@aarjithn
aarjithn / Regex whitelist
Created Jan 11, 2016
Regex to match all apart from list of words
View Regex whitelist
^(?!list|of|words).*
@aarjithn
aarjithn / checkIfUnique.js
Last active Oct 20, 2015
Check if there are duplicate (primitive) values in array
View checkIfUnique.js
function checkIfUnique(array) {
var map = {};
for(var i = 0, size = array.length; i < size; i++) {
if (map[array[i]]) {
return false;
}
map[array[i]] = true;
}
return true;
}