Skip to content

Instantly share code, notes, and snippets.

Avatar

Simona Clapan symonny

View GitHub Profile
View angular-address-autocomplete.js
/* based on https://github.com/kuhnza/angular-google-places-autocomplete */
angular.module('google.places', [])
/**
* DI wrapper around global google places library.
*
* Note: requires the Google Places API to already be loaded on the page.
*/
.factory('googlePlacesApi', ['$window', function ($window) {
if (!$window.google) throw 'Global `google` var missing. Did you forget to include the places API script?';
@symonny
symonny / angular-textarea-autosize.txt
Last active Apr 29, 2016
angular-textarea-autosize
View angular-textarea-autosize.txt
.directive('autoSize', ['$timeout', function($timeout) {
return function (scope, element, attr, ctrl) {
var minHeight;
var $shadowtx = angular.element("<textarea class='" + attr['class'] + "'></textarea>");
//add to element parent
angular.element(element.parent()[0]).append($shadowtx);
element.css({resize: "none"}).parent().css({ position: "relative" });
var update = function (addtext) {
$shadowtx.val(element.val() + (addtext ? addtext: ''));
View gist:b3541632b1bfbdad2e71
/*based on https://github.com/xoxco/node-slack/blob/master/slack.js*/
/* add file in /lib
init in server.js
var configs = {
token:"XXX",
channel:"#studio-binder",
username:"studibinder",
domain:"leanometry",
icon_url: 'http://studiobinder.com/static/img/email-bubble.png',
@symonny
symonny / collection.liquid
Last active Aug 29, 2015
Autoscroll for collection page - Shopify
View collection.liquid
{% comment %}
<a href="#" class="scrollup"></a>
{% endcomment %}
<section class="content content-area">
{% include 'breadcrumbs' %}
{% capture collection_url %}{% if collection.url.size == 0 %}/collections/all{% else %}{{ collection.url }}{% endif %}{% endcapture %}
<div class="page-title">