Skip to content

Instantly share code, notes, and snippets.

@aarjithn
aarjithn / env-config.js
Created February 8, 2017 08:14
Gulp environment config
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 March 14, 2020 11:07
Sliding Segments Ionic v2
<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 June 26, 2016 18:30
Swiper Card Carousel in Ionic
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 January 11, 2016 12:50
Regex to match all apart from list of words
^(?!list|of|words).*
@aarjithn
aarjithn / checkIfUnique.js
Last active October 20, 2015 12:58
Check if there are duplicate (primitive) values in array
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;
}