Skip to content

Instantly share code, notes, and snippets.

View jwlawrence's full-sized avatar

Joshua Lawrence jwlawrence

View GitHub Profile
import Ember from 'ember';
const { Controller, inject } = Ember;
export default Controller.extend({
display: inject.service(),
actions: {
toggle() {
this.get('display').toggleVisibility();
}
import Ember from 'ember';
const { Controller, inject } = Ember;
export default Controller.extend({
display: inject.service(),
actions: {
toggle() {
this.get('display').toggleVisibility();
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: JSON.stringify({
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string"
import Ember from 'ember';
const { Controller, inject } = Ember;
export default Controller.extend({
display: inject.service(),
actions: {
toggle() {
this.get('display').toggleVisibility();
}
@jwlawrence
jwlawrence / controllers.application.js
Last active April 30, 2017 23:54
ember-tri-state
import Ember from 'ember';
const { computed, Controller } = Ember;
export default Controller.extend({
showLastSuccessful: true,
actions: {
resetShowLastSuccessful() {
this.set('showLastSuccessful', true);
@jwlawrence
jwlawrence / placeholder_polyfill.js
Created May 31, 2013 19:14
If browser does not support HTML5 placeholder attribute, simulate the effect with jQuery
$('.search-box').each(function(){
if(!Modernizr.input.placeholder){
var $el = $(this),
placeholderText = $el.attr('placeholder');
if( placeholderText ){
$el.addClass('placeholder-text').val(placeholderText)
.bind('focus', function() {
if( $el.val() === placeholderText ) {
$el.val('').removeClass('placeholder-text');
@jwlawrence
jwlawrence / maintenance.html
Last active December 16, 2015 10:59
Temporary maintenance page
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Down For Maintenance</title>
<style>
body { background: #fff; font-family: Helvetica,Arial,sans-serif; margin: 0; padding: 0; }
img { border: 0; }
.wrapper { width: 500px; margin: 0 auto; }
@jwlawrence
jwlawrence / font-icons.css
Created November 21, 2011 19:40
Font Icons
.icon:before {
font-family: icons;
margin-right: 5px;
}
.icon-replace {
text-indent: -9999px;
overflow: hidden;
display: inline-block;
position: relative;
min-width: 1em;
@jwlawrence
jwlawrence / jQuery Function
Created May 16, 2011 19:25
Helpful jQuery functions
// Ghost Text
$(".populate input").each(function() {
if ($(this).val() == "") {
$(this).val($(this).attr("title"));
}
});
$(".populate input").focus(function() {
if ($(this).val() == $(this).attr("title")) {
$(this).val("");
}
@jwlawrence
jwlawrence / gist:821550
Created February 10, 2011 22:57
Event Info with hCalendar Microformats
<!-- http://microformats.org/code/hcalendar/creator -->
<div id="hcalendar-event" class="vevent">
<a href="http://www.baltimore.com" class="url">
<abbr title="2011-02-14T10:30-05:0000" class="dtstart">February 14th 10:30am</abbr>-
<abbr title="2011-02-15T11:15-05:00" class="dtend"> 11:15am 2011</abbr> :
<span class="summary">event</span> at
<span class="location">baltimore</span>
</a>
<div class="description">This is a super cool event in Baltimore.</div>
<div class="tags">