TODO: make gem for this
This was tested using Rails 3.2 and Rails 4.0 on Ruby 2.0.0.
-
Set the install directory for Bower components:
// .bowerrc
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
#!/bin/sh | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by jay@gooby.org http://github.com/jaygooby | |
# based on http://gist.github.com/308216 by http://github.com/mguterl | |
# | |
## A sample /etc/unicorn/my_app.conf | |
## |
# lib/custome_parse_json | |
# Custome middleware to include pagination data | |
class CustomParseJSON < Her::Middleware::ParseJSON | |
# Parse the response body | |
# | |
# @param [String] body The response body | |
# @param [Hash] header the respone header | |
# @return [Mixed] the parsed response | |
# @private | |
def parse(body, header=nil) |
/** | |
* Custom cell to display handlebars template | |
*/ | |
HandlebarsCell = Backgrid.Cell.extend({ | |
className: 'handlebars-cell', | |
render: function () { | |
this.$el.empty(); | |
this.$el.html(this.column.get('template')({ model: this.model.toJSON() })); |
// If condiational helper | |
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) { | |
switch (operator) { | |
case '==': | |
return (v1 == v2) ? options.fn(this) : options.inverse(this); | |
case '===': | |
return (v1 === v2) ? options.fn(this) : options.inverse(this); | |
case '<': | |
return (v1 < v2) ? options.fn(this) : options.inverse(this); | |
case '<=': |
# to execute this gist, run the line bellow in terminal | |
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh |
## Server configuration for nginx to host Atlassian Jira / Jetbrain TeamCity or any other Tomcat web application | |
# | |
# author cedric.walter, www.waltercedric.com | |
# to be saved for ex in /etc/nginx/sites-available/example | |
server { | |
listen 80; | |
server_name jira.example.com; | |
access_log off; | |
location / { |
{{-- Define all our servers --}} | |
@servers(['staging' => '', 'production' => '']) | |
@setup | |
{{-- The timezone your servers run in --}} | |
$timezone = 'Europe/Amsterdam'; | |
{{-- The base path where your deployments are sitting --}} | |
$path = '/var/www/site.com/htdocs'; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"