Skip to content

Instantly share code, notes, and snippets.

View arnabdas's full-sized avatar

Arnab Das arnabdas

View GitHub Profile
@arnabdas
arnabdas / domManipulate.js
Created March 12, 2014 05:46
DOM manipulation in 100 lines (AbsurdJS component)
var dom = function(el, parent) {
var api = { el: null };
var qs = function(selector, parent) {
parent = parent || document;
return parent.querySelector(selector);
};
var qsa = function(selector, parent) {
parent = parent || document;
return parent.querySelectorAll(selector);
};
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@arnabdas
arnabdas / states-provinces.json
Last active August 29, 2015 14:02
Provinces/States with Country codes in JSON Format
[{
"id": "AD-02",
"name": "Canillo",
"country": "AD"
},
{
"id": "AD-03",
"name": "Encamp",
"country": "AD"
},
@arnabdas
arnabdas / data.json
Created April 7, 2015 16:37
Nested template generation by Handlebars
[
{
"name": "abcd",
"children": [
{
"name": "fgtf",
"children": [
]
},
@arnabdas
arnabdas / bootstrap-responsive-tabs.html
Created May 7, 2015 09:34
Responsive Tabs with Bootstrap and jQuery
<!DOCTYPE html>
<!--
Copyright 2015 Arnab Das
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@arnabdas
arnabdas / app.js
Created May 28, 2015 05:33
This AngularJS modules/dependencies thing is a lie
http://michalostruszka.pl/blog/2015/05/21/angular-dependencies-naming-clash/
/* You can request a factory of a certain module explicitly (without dependency injection) */
var injector = angular.injector(['thirdParty1']);
var hello1 = injector.get('hello');
var injector = angular.injector(['thirdParty2']);
var hello2 = injector.get('hello');
@arnabdas
arnabdas / video-to-mp3.sh
Created May 28, 2015 09:51
FFMPEG: Video to mp3
# http://davidwalsh.name/convert-video-mp3
ffmpeg -i music-video.webm -vn -ar 44100 -ac 2 -ab 192 -f mp3 music.mp3
@arnabdas
arnabdas / timzone.json
Last active August 29, 2015 14:25
Timezone list
[{
"abbreviation": "A",
"name": "Alpha Time Zone",
"displayName": "Alpha Time Zone(UTC + 1)",
"offset": "1 hours"
},
{
"abbreviation": "ACDT",
"name": "Australian Central Daylight Time",
"displayName": "Australian Central Daylight Time(UTC + 10:30)",
@arnabdas
arnabdas / create_key.sh
Last active August 9, 2017 12:24 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@arnabdas
arnabdas / location.html
Created October 31, 2015 17:18
A small directive using location api of browser
<div class="row">
<div class="col-md-6 text-center">
<img
ng-src="https://maps.googleapis.com/maps/api/staticmap?center={{location.latitude}},{{location.longitude}}&zoom=14&size=400x300&sensor=false"
alt="Not Available">
</div>
<div class="col-md-6">
<form>
<div class="form-group">
<label>Latitude</label>