Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash -e
# Transforms a SVG into a PNG for each platform
# Sizes extracted from
# http://developer.android.com/design/style/iconography.html
# https://stackoverflow.com/a/23015417/2560946
[ -z $2 ] && echo -e "ERROR: filename and one dimension (-w or -h) is required, for example:\nsvg2png -w48 icon.svg\n" && exit 1;
FILENAME=$2
DEST_FILENAME=`echo $2 | sed s/\.svg/\.png/`
FLAG=`echo $1 | cut -c1-2`
@qalqi
qalqi / loadMore.js
Last active August 29, 2015 14:17 — forked from fraserxu/loadMore.js
Load More Toggled to Load Less
// set the default amount of items being displayed
var defaultvalue = 3;
$scope.limit= defaultvalue;
$scope.ismore = false;
// loadMore function
$scope.loadMore = function() {
$scope.limit = $scope.items.length;
$scope.ismore = true;
@qalqi
qalqi / EmailController.js
Last active August 29, 2015 14:16
SailsJs Mandrill Controller to send emails from SailJs
/**
* EmailController
* @require :: npm install machinepack-mandrill --save
* @model :: sails generate email
* @description :: SailsJs Server-side logic for serving Emails using Mandrill https://mandrill.com/ [12000 Free Emails]
* @help :: See http://links.sailsjs.org/docs/controllers
*/
var Mandrill = require('machinepack-mandrill');
module.exports = {
@qalqi
qalqi / Angular Components
Last active August 29, 2015 14:15
Angular Components
https://github.com/angular-ui/ui-slider
Requires
JQuery
JQueryUI
AngularJS
http://vitalets.github.io/angular-xeditable/
Angular-xeditable is a bundle of AngularJS directives that allows you to create editable elements.
Such technique is also known as click-to-edit or edit-in-place.
It is based on ideas of x-editable but was written from scratch to use power of angular and support complex forms / editable grids.