Skip to content

Instantly share code, notes, and snippets.

ng-class="tadaONchange" <---use this on an item
<button ng-click="tadaOnChange()"class="button">tada</button>
$rootScope.tadaOnChange = function(){
console.log("$scope.tadaONchange: ",$scope.tadaONchange);
$scope.tadaONchange = "tada";
$timeout(function () {
@garrettmac
garrettmac / 0_reuse_code.js
Created June 27, 2016 00:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@garrettmac
garrettmac / gist:b30cd42031085c35e4ad24fca02aec80
Last active September 26, 2016 22:56
typescript promist
promiseExmple(){
return new Promise((resolve, reject) => {
setTimeout(()=>{reject('its been 5 sec')},5000)
});
}
/* ------------- */
this.user.promiseExmple().then((result)=>{
console.log("result: ",result)
}).catch((err)=>{
console.log("promise failed: ",err)
@garrettmac
garrettmac / app.js
Last active July 21, 2017 18:31
simple gulp recipe to sever any projects dist folder with express & node. Just add these to a project then move any project you'd like to server at the root and rename the folder 'frontend' and you're done
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
// res.sendfile('./public/index.html');
@garrettmac
garrettmac / Contract Killer 3.md
Created November 30, 2016 16:08
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@garrettmac
garrettmac / custom.filter.buttons.tags.liquid
Last active March 15, 2023 00:10
Shopify Filter Snippets
Tag Filter:
<ul class="subnav clearfix">
<li{% unless current_tags %} class="active"{% endunless %}>
{% if collection.handle %}
<a href="/collections/{{ collection.handle }}{% if collection.sort_by %}?sort_by={{ collection.sort_by }}{% endif %}">All</a>
{% elsif collection.current_type %}
<a href="{{ collection.current_type | url_for_type | sort_by: collection.sort_by }}">All</a>
@garrettmac
garrettmac / collection.liquid
Last active April 4, 2017 19:57
Shopify Used-Radios.com
{% comment %}
{% assign productsPerPage = settings.collection-products-number-of-rows | times: settings.collection-products-per-row %}
{% endcomment %}
{% assign productsPerPage = 370 %}
{% paginate collection.products by productsPerPage %}
{% assign platforms = 0 %}
{% if settings.share-widget-facebook %}{% assign platforms = platforms | plus: 1 %}{% endif %}
{% if settings.share-widget-twitter %}{% assign platforms = platforms | plus: 1 %}{% endif %}
{% if settings.share-widget-pinterest %}{% assign platforms = platforms | plus: 1 %}{% endif %}
{% if settings.share-widget-fancy %}{% assign platforms = platforms | plus: 1 %}{% endif %}
@garrettmac
garrettmac / hero.ts
Created January 21, 2017 22:57 — forked from brennanMKE/hero.ts
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
Garrett,
Don’t shoot the messenger. This is a preliminary list of change requests I have received so far…
Let me know what you can to address and what will require additional costs. Some of this we might be able to do if you show us how to navigate, I tried to put this together in a way similar to navigating the site. A lot of it is UI/UX stuff.
Logo: Insert our old Used-Radios.com logo so we don’t have to rebrand all of our marketing documentation.
@garrettmac
garrettmac / cheatsheet.md
Created February 7, 2017 19:03
terminal commands

Terminal

remove file rm -rf [folder] find mdfind -onlyin [file]

alias Create an alias •