Skip to content

Instantly share code, notes, and snippets.

@symonny
symonny / collection.liquid
Last active August 29, 2015 14:04
Autoscroll for collection page - Shopify
{% 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">
/*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 / angular-textarea-autosize.txt
Last active April 29, 2016 02:12
angular-textarea-autosize
.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: ''));
/* 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?';