Skip to content

Instantly share code, notes, and snippets.

View ToddSmithSalter's full-sized avatar

Todd Smith-Salter ToddSmithSalter

View GitHub Profile
@jerel
jerel / controllers-post.js
Last active August 29, 2015 14:05
Ember 1.7 comment pagination example extracted from a working app
import Ember from 'ember';
export default Ember.ObjectController.extend({
queryParams: ['page'],
page: 1,
comments: Ember.K(),
paginationObserver: function() {
var id = this.get('id'),
page = this.get('page'),
@mexitek
mexitek / ignoreConfigs.sh
Created September 19, 2011 18:38
Remove and untrack test/config files in Git
echo "*.config">>.gitignore;
git rm --cached "*.config";
git add .;
git commit -m "Ignoring and deleting config files." ;
git push origin;
anonymous
anonymous / gist:1610208
Created January 14, 2012 04:03
Grab a twitter user's avatar
// Grab a twitter user's avatar with php
//
// usage:
// $photo = get_tiwtter_avatar('alexpgates');
//
// requires xmlize to parse xml into an array
// xmlize is available here: https://github.com/rmccue/XMLize
function get_twitter_avatar($u){
$Url = "http://twitter.com/users/$u.xml";
@replete
replete / _mixin_2ximages.scss
Created October 11, 2012 19:19
Images 2x - retina images mixin
@mixin image-2x($image1, $image2) {
background-image: url($image);
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
background-image: url($image2);
background-size: image-width($image1) image-height($image1);
}
@keithbro
keithbro / Ember.Enumerable.invoke.md
Last active October 27, 2015 21:14
Use of .invoke() instead of .forEach()

Did you know?

array.forEach(function(element) {
  element.doSomething(arg1, arg2);
});

Is equivalent to...

@pixelhandler
pixelhandler / ember-cli-upgrade-1.13.8-to-1.13.13.sh
Last active December 6, 2015 22:49
Bash script to update dependencies (based on release notes) for an ember-cli app or addon, v1.13.8 -> v1.13.13
#!/usr/bin/env bash
# Use with arg $1 as --app or --addon and optional arg $2 as --backup to keep a copy of the original files
#
# Upgrade Ember-CLI dependencies from 1.13.8 to 1.13.13
#
# - https://github.com/twokul/ember-cli-release-notes/commit/1cee41eb91bf7c534917fdd4cd42a1cd1a481c75
# - https://github.com/ember-cli/ember-cli/releases/tag/v1.13.12
# - https://github.com/ember-cli/ember-cli/releases/tag/v1.13.13
@jackie
jackie / breakpoints.json
Last active December 19, 2015 15:28
Sass Script function to get breakpoint values from a JSON file.
{
"phone" : "all and (max-width: 603px)",
"desktop": "all and (min-width: 1025px)",
"tablet" : "all and (min-width: 604px) and (max-width: 1024px)"
}
@thepsion5
thepsion5 / LaravelValidator.php
Last active November 10, 2016 07:25
Demonstration of a simple wrapper for Laravel's Validator that allows rules to be altered based on input before validating and exceptions as transports for validation errors
<?php
use Illuminate\Support\MessageBag,
Illuminate\Validation\Factory;
/**
* A simple wrapper for Laravel's native validator. Allows
* validation rules to be modified pre-validation based on
* input and can be used to throw an exception with the
* input and validation failures
@dustinfarris
dustinfarris / circle.yml
Last active February 14, 2017 19:48
CircleCI script for Ember-CLI projects
machine:
node:
version: 0.10.28
dependencies:
pre:
- npm install -g bower
override:
- npm i
- bower i
deployment:
@BrianSipple
BrianSipple / ember-addon-essentials.md
Last active April 17, 2017 18:27
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json