Skip to content

Instantly share code, notes, and snippets.

@Rakonda
Rakonda / app.js
Created December 15, 2015 15:11 — forked from jdnichollsc/app.js
Service with Angular.js in Ionic Framework to get Products from Web Service or Local Storage using Promises and ngCordova
var app = angular.module('demo', ['ionic', 'ngCordova', 'demo.controllers', 'demo.services']);
var controllers = angular.module('demo.controllers', []);
var services = angular.module('demo.services', []);
@Rakonda
Rakonda / svg2png.js
Created October 22, 2015 22:14 — forked from gustavohenke/svg2png.js
SVG to PNG
var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
'use strict';
angular.module('yourApp')
.directive 'file', [ () ->
restrict: "E"
template: "<input type=\"file\" />"
replace: true
require: "ngModel"
link: (scope, element, attr, ctrl) ->
listener = ->
@Rakonda
Rakonda / Less-snippets.less
Created January 21, 2015 15:46
This is a sample less snippets, very useful when it comes to some of CSS3 aspects.
/* Less snippets */
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}
/**
* jQuery alterClass plugin
*
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
*
* Copyright (c) 2011 Pete Boere (the-echoplex.net)
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
*
*/