Skip to content

Instantly share code, notes, and snippets.

View berislavbabic's full-sized avatar
🏠
Working from home

Berislav Babic berislavbabic

🏠
Working from home
View GitHub Profile
@tcannonfodder
tcannonfodder / freckle_recurring_budgets.rb
Created April 14, 2014 14:23
Sample script to create recurring project budgets for specific projects in your Freckle account using the API.
# Hey there!
#
# This is a basic script that shows how to give projects an "allowance", like
# 5 hours every month. First, it looks at how many hours you want to budget for
# each project. Then, it establishes a connection with the Freckle API, using your
# API token. It then loops through all the projects you listed, finding out how many
# minutes it needs to add or remove from the existing project budget. Finally, it
# updates the project and goes onto the next one.
#
# If you want to set a monthly budget, you would run this script once every month.
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@nthj
nthj / gist:5297916
Last active December 15, 2015 17:39 — forked from shripadk/gist:552554
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
Note: I am not using the Heroku Zerigo DNS add-on, instead I have a separate Zerigo account for my DNS needs. I do this because Zerigo offers 30 hosts on free direct accounts, versus only 10 hosts on the free Heroku add-on.
@malarkey
malarkey / Three Wise Monkeys.md
Created December 2, 2012 14:26
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@malarkey
malarkey / Contract Killer 3.md
Last active May 13, 2024 13:18
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@rawsyntax
rawsyntax / config
Created July 11, 2012 16:43
faster ssh
Host *
# don't try to authenticate with Kerberos
GSSAPIAuthentication no
GSSAPIKeyExchange no
# persist the ssh connection for 5 minutes
# subsequent ssh connections respond faster because its reusing an existing connection
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
ControlPersist 5m
@stevenwilkin
stevenwilkin / gist:2587565
Created May 3, 2012 17:49 — forked from dhh/gist:2492118
How DHH tamed the 500-line routes.rb file in the new Basecamp
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@yulrizka
yulrizka / sorcery_helper.rb
Created March 18, 2012 09:35
Helper for login in sorcery on request spec
# spec/support/sorcery_helper.rb
module Sorcery
module TestHelpers
module Rails
def login_user_post(user, password)
page.driver.post(sessions_url, { username: user, password: password})
end
end
end
@ream88
ream88 / 0-README.md
Created March 1, 2012 11:47
Ruby-1.9.x debugger install script

Ruby-1.9.3 debugger install script

This script will install ruby-debug19 under your current Ruby 1.9.3 environment.

Requirements

  • rbenv

Installation

@wisq
wisq / gist:1507733
Created December 21, 2011 21:14
Why I love zsh (and hate being forced to use bash)

Why I love zsh (and hate being forced to use bash)

  • Smarter completion. A few examples:
  • context sensitive -- if you have file "name1" and directory "name2", "cd nam<TAB>" completes to "name2/"
  • "tar xf <TAB>" completes to tarballs only. "unrar x <TAB>" completes to RARs only. etc.
  • rsync / scp completion: "rsync host:anything/<TAB>" shows you files on host under anything/
  • also works with rsync:// URLs
  • SSH host completion from ~/.ssh/config & ~/.ssh/known_hosts
  • lots of other smart completions: Rake tasks, git commands & SHAs, dpkg packages, dash-options for most commands, etc etc.