Skip to content

Instantly share code, notes, and snippets.

View Deminem's full-sized avatar

Adnan Urooj Deminem

View GitHub Profile
/* **************************************************************************
Copyright 2012 Calvin Rien
(http://the.darktable.com)
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
@Deminem
Deminem / license-badges.md
Created January 15, 2017 12:55 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Want to add a License?

Comment this gist or write me an E-Mail (lukas@himsel.me)

@Deminem
Deminem / sample.js
Created March 19, 2017 06:47
A simple javascript to ordered the collection through given property and also calculate the average
(function() {
'use strict';
// create a person
function Person(name, ranking) {
this.name = name;
this.ranking = ranking;
this.toString = function() {
return '[' + this.name + ' ' + this.ranking + ']';
}
@Deminem
Deminem / Array#flatten.js
Created March 19, 2017 16:52
A simple javascript code snippet that provide the flatten method for nested arrays of objects. Raw
(function() {
'use strict';
// create a method which flatten nested arrays of objects
Array.prototype.flatten = function() {
var flatten = [];
this.slice(0).forEach(function(elem) {
if (Array.isArray(elem)) {
// handle deep level nesting
var result = elem.flatten();