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
#!/bin/bash | |
wget -m http://localhost:3000/api/docs | |
mv localhost\:3000/ api-documentation | |
mv ./api-documentation/api/docs ./api-documentation/api/docs.html |
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
'use strict'; | |
/** | |
* An ng-include replacement which transparently inherits the parent scope and also allows local customisation of variables | |
* within the snippet. | |
* | |
* Designed to use $templateCache (in production) and fallback to an AJAX request (for dev-mode) to load view templates. | |
* | |
* Use as below (can customise variables used in the snippet via ng-init): | |
* <div include="'users/_password_confirmation_input.html'" ng-init="placeholder = 'Re-enter Password'"></div> |
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
Set StrictHostKeyChecking no in your ~/.ssh/config file, where it will be the default for only the current user. Or you can use it on the command line: | |
ssh -o StrictHostKeyChecking=no -l $user $host |
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
<div ng-if="false"> | |
<!-- | |
Here is a comment which will not be shown in production code. | |
--> | |
</div> |
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())); | |
}, | |
NewerOlder