Skip to content

Instantly share code, notes, and snippets.

@mrzmyr
mrzmyr / karma.e2e.dev.coffee
Created September 5, 2013 21:21
Karma 0.11 Sample Config – custom launchers
# Karma configuration
# Generated on Thu Sep 05 2013 22:19:47 GMT+0200 (CEST)
module.exports = (config) ->
config.set
# base path, that will be used to resolve all patterns, eg. files, exclude
basePath: '..'
customLaunchers:
var env = 'prod';
var dummyConsole = {};
for(var fn in console.__proto__) dummyConsole[fn] = function() {};
if(env === 'prod' && window.console) window.console = dummyConsole;
@mrzmyr
mrzmyr / example.html
Last active December 30, 2015 00:29
Share directives for google plus, facebook and twitter incl. popup service.
<a
href="javascript:void(0)"
facebook-share
app-id="{{ appId }}"
image="{{ image }}"
url="{{ url }}"
title="{{ title }}"
description="{{ description }}"
>
Share with Facebook
@mrzmyr
mrzmyr / google-maps.html
Created December 9, 2013 11:37
Google Maps Polyline Example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple Polylines</title>
<style>
html, body, #map {
height: 100%;
margin: 0px;
@mrzmyr
mrzmyr / javascript_resources.md
Created April 2, 2014 03:28 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mrzmyr
mrzmyr / groupBy.js
Created April 17, 2014 10:31
AngularJS – groupBy filter
angular.module('filters.groupBy', [])
.filter('groupBy', function() {
return function(items, groupedBy) {
if (items) {
var finalItems = [],
thisGroup;
for (var i = 0; i < items.length; i++) {
if (!thisGroup) {
@mrzmyr
mrzmyr / app.js
Last active January 6, 2019 07:31
AngularJS – readmore directive
angular.module('app', [])
.filter('truncate', function () {
return function (text, length, end) {
if (isNaN(length)) {
length = 10;
}
if (end === undefined) {
end = '...';
@mrzmyr
mrzmyr / platform.js
Created March 26, 2015 00:48
Angular Browser / Platform Detection Service
// Credits: http://stackoverflow.com/q/9514179/237209
app.factory('platform', [function () {
var unknown = '-';
//browser
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browser = navigator.appName;
@mrzmyr
mrzmyr / gist:977fc7d8bee58db9d96f
Last active September 10, 2020 10:04
Launching external maps applications (Ionic, Google Maps, Apple Maps) on Android and iOS
<!-- https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html -->
<a href="maps://?q=dallas" data-rel="external">iOS launch in apple maps</a>
<!-- https://developers.google.com/maps/documentation/ios/urlscheme -->
<a href="comgooglemaps://?q=dallas" data-rel="external">iOS launch in google maps</a>
<a href="geo://0,0?q=dallas" data-rel="external">Android launch in google maps</a>