Skip to content

Instantly share code, notes, and snippets.

View arjunasuresh3's full-sized avatar

Arjun Suresh arjunasuresh3

  • zeomega
  • bangalore
View GitHub Profile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@arjunasuresh3
arjunasuresh3 / ui-router-to-angular-router.md
Created October 6, 2021 17:06 — forked from zaenk/ui-router-to-angular-router.md
Migrating AngularJS UI Router to Angular Router

Migrating AngularJS UI Router to Angular Router

This migration path focuses on AngularJS UI Router and Angular Router interopability,

This method not good for everyone! The main characteristics of this path is that the AngularJS and Angular apps does not share the same layout. So new components are always introduced in Angular, old components are rewritten and downgraded for AngularJS. Migration of old modules happens at once, when almost all components are updated. UI Router states cannot be reused in Angular, so every state and listener should bre rewriten to routes and event listeners or strategies for Angular Router.

Prerequisites

@Component({
selector: 'add-story-form',
template: `
<div class="container">
<h1>New Story</h1>
<form [formGroup]="newStory"
(submit)="submit($event)"
(success)="onSuccess()"
(error)="onError($event)"
connectForm="newStory">
@arjunasuresh3
arjunasuresh3 / xmldiff.py
Created April 8, 2020 07:34 — forked from dalelane/xmldiff.py
Comparing XML files ignoring order of attributes and elements - see http://dalelane.co.uk/blog/?p=3225 for background
##########################################################################
#
# xmldiff
#
# Simple utility script to enable a diff of two XML files in a way
# that ignores the order or attributes and elements.
#
# Dale Lane ([email protected])
# 6 Oct 2014
#
@arjunasuresh3
arjunasuresh3 / composing-software.md
Created March 9, 2019 03:24 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
app.directive('faFastScroll', ['$parse', function ($parse) {
var Interval = function(min, max) {
this.min = min || 0;
this.max = max || 0;
};
Interval.prototype.clip = function(min, max) {
if(this.max <= min || this.min >= max) {
this.min = this.max = 0;
var src = [
{"created_at":"Sun Jun 10 05:56:54 +0000 2012","id":211698435269722112,"id_str":"211698435269722112","text":"Timothy Bradley wins by split decision to claim Manny Pacquiao\u2019s WBO welterweight title http:\/\/t.co\/4SvRaLmb","source":"web","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":759251,"id_str":"759251","name":"CNN","screen_name":"CNN","location":"","description":"Connecting you to breaking news, the biggest moments and interviews from CNN TV, and the stories and videos garnering attention on CNN.com and social media.","url":"http:\/\/www.cnn.com","protected":false,"followers_count":4797672,"friends_count":649,"listed_count":68036,"created_at":"Fri Feb 09 00:35:02 +0000 2007","favourites_count":2,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":true,"statuses_count":25664,"lang":"en","contributors_enabled":true,
@arjunasuresh3
arjunasuresh3 / gist:3e8b8524e8fb8166d8ed4ab1254b6e32
Last active April 19, 2016 13:53 — forked from cheald/gist:2905882
msgpack vs json in browser
var src = [
{"created_at":"Sun Jun 10 05:56:54 +0000 2012","id":211698435269722112,"id_str":"211698435269722112","text":"Timothy Bradley wins by split decision to claim Manny Pacquiao\u2019s WBO welterweight title http:\/\/t.co\/4SvRaLmb","source":"web","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":759251,"id_str":"759251","name":"CNN","screen_name":"CNN","location":"","description":"Connecting you to breaking news, the biggest moments and interviews from CNN TV, and the stories and videos garnering attention on CNN.com and social media.","url":"http:\/\/www.cnn.com","protected":false,"followers_count":4797672,"friends_count":649,"listed_count":68036,"created_at":"Fri Feb 09 00:35:02 +0000 2007","favourites_count":2,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":true,"statuses_count":25664,"lang":"en","contributors_enabled":true,
@arjunasuresh3
arjunasuresh3 / angular-bc.js
Created March 11, 2016 08:08 — forked from vojtajina/angular-bc.js
Angular: BC module for scope/controller separation
/**
* @license AngularJS
* (c) 2010-2012 AngularJS http://angularjs.org
* License: MIT
*/
/**
* Backward compatibility module for AngularJS
* @author Vojta Jina <[email protected]>
*
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];