This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import sbt.Keys._ | |
import play.Project._ | |
import sbtbuildinfo.Plugin._ | |
import com.gu.SbtJasminePlugin._ | |
object ApplicationBuild extends Build { | |
val appName = "your-app-name" | |
val appVersion = "1.0-SNAPSHOT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in config/puma.rb | |
on_worker_boot do |worker_number| | |
# only create scheduler on first worker thread | |
if worker_number === 0 | |
$scheduler_thread = true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* assume you have a HB template compiled called 'question_btn' | |
which contains {{outlet}} within it as optional embedded content | |
# example of question_btn.hbs | |
<a target="_blank" href="{{question_url}}"> | |
<button type="button" class="pull-right btn question" title="ask seller a question"> | |
{{#if outlet}}{{outlet}}{{else}}<i class="icon-question-sign"></i>{{/if}} | |
</button> | |
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="JSHintConfiguration" version="2.1.0" use-config-file="false"> | |
<option bitwise="true" /> | |
<option camelcase="true" /> | |
<option curly="true" /> | |
<option eqeqeq="false" /> | |
<option forin="true" /> | |
<option immed="false" /> | |
<option latedef="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add gem 'emblem-rails' to your Rails Gemfile and run 'bundle' | |
// create your template file in your Rails project | |
/app/assets/javascripts/templates/test.raw.emblem eg. 'h1 {{title}} world' | |
// add the following to your Rails application.js | |
Ember = {TEMPLATES: [], Handlebars: Handlebars} | |
//= require_tree ./templates | |
// anywhere later in your code - call it as a compiled template: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* responsive break points - customise to suit or add more */ | |
$break-small: 480px; | |
$break-medium: 768px; | |
$break-large: 940px; | |
$break-x-large: 1140px; | |
/* how to use: | |
@include devices(mobile) { - targets a single device | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['backbone'], | |
function(Backbone) { | |
return Backbone.Model.extend({ | |
_storage: localStorage || {setItem: function() {}, getItem: function() {return {};}}, | |
saveToStorage: function() { | |
this._storage.setItem(this._getKey(), JSON.stringify(this.toJSON())); | |
}, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(toggle: String)(enabledContent: Any)(disabledContent: Any) | |
@import play.api._ | |
@defining(Play.current.configuration.getBoolean("toggles." + toggle)) { toggleValue => | |
@toggleValue match { | |
case Some(toggleEnabled) => { | |
@if(toggleEnabled) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deferred = new $.Deferred(); | |
result.fadeTo(2000, 0.4, function() { | |
deferred.resolve(); | |
}); | |
deferred.done( | |
function() {result.addClass('ending'); result.fadeTo(2000, 1.0, function() { | |
deferred = new $.Deferred().resolve(); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!this.opts.allowClear) { | |
this.container.removeClass("select2-allowclear"); | |
} |
NewerOlder