Skip to content

Instantly share code, notes, and snippets.

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

Raphael Randschau nicolai86

🏠
Working from home
View GitHub Profile
@nicolai86
nicolai86 / app-alpha-2.conf
Created February 24, 2012 19:21
example supervisord export from foreman
[program:app-alpha-1]
command=./alpha
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/app/alpha-1-out.log
stderr_logfile=/var/log/app/alpha-1-err.log
user=app
directory=/tmp/app
@nicolai86
nicolai86 / custom_authenticator.rb
Created March 1, 2012 21:52
Custom authenticator to be used by rubycas-server
# encoding: UTF-8
require 'casserver/authenticators/sql'
require 'devise/encryptors/base'
require 'devise/encryptors/sha1'
class CustomAuthenticator < CASServer::Authenticators::SQL
# snip from devise lib
def secure_compare(a, b)
return false unless a.present? && b.present?
@nicolai86
nicolai86 / app.conf
Created March 1, 2012 21:54
Sample supervisord configuration file generated by foreman
[program:app-unicorn]
command=/home/app-user/.rvm/bin/app_bundle exec unicorn -c config/unicorn.rb -E production
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/home/app-user/shared/log/unicorn-1-out.log
stderr_logfile=/home/app-user/shared/log/unicorn-1-err.log
user=app-user
directory=/home/app-user/current
environment=PORT=5000,VERBOSE=0,QUEUE=*,RAILS_ENV=production
@nicolai86
nicolai86 / traq_setup.sh
Created January 17, 2013 17:24
traq + XDG_CONFIG_HOME
mkdir $XDG_CONFIG_HOME/traq
git clone git@github.com:nicolai86/traq.git $XDG_CONFIG_HOME/traq/traq
echo "export PATH=$PATH:$XDG_CONFIG_HOME/traq/traq" >> ~/.bash_profile
echo "export TRAQ_PATH=$XDG_CONFIG_HOME/traq/traq" >> ~/.bash_profile
. ~/.bash_profile
require 'valid_subdomain'
# config/routes
Rails::Application.routes.draw do
constraints(::ApplicationController::ValidSubdomain) do
resource :lol
end
end
@nicolai86
nicolai86 / sync-postgres-mina.rb
Last active May 12, 2017 07:27
sync down the content of a postgresql database used by a rails application using mina.
RYAML = <<-BASH
function ryaml {
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
};
BASH
namespace :sync do
task :db do
isolate do
invoke :environment
@nicolai86
nicolai86 / sync-mysql-mina.rb
Last active December 3, 2018 07:17
sync down the content of a mysql database used by a ruby on rails application using mina.
RYAML = <<-BASH
function ryaml {
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
};
BASH
namespace :sync do
task :db do
isolate do
invoke :environment
@nicolai86
nicolai86 / calendar.coffee
Last active November 5, 2019 14:16
do it yourself calendar.
isSunday = (date) ->
return date.getDay() is 0
nextDay = (date, days = 1) ->
newDate = new Date(date.getTime())
newDate.setDate(date.getDate() + days)
return newDate
prevDay = (date, days = 1) ->
newDate = new Date(date.getTime())
@nicolai86
nicolai86 / ansible-rails example
Created February 12, 2014 06:11
a current usage example for nicolai86.rails-deployment as of v0.6.0
---
- hosts: server
user: app_user
gather_facts: False
vars:
user: app_user
home_directory: "/home/{{ user }}"
deploy_to: "{{ home_directory }}/app"
roles:

alt

What’s important to you in the development of a product?

Jobs: One of the things that really hurt Apple was after I left, John Scully got a very serious disease.

And that disease - I’ve seen other people get it too - it’s the disease of thinking that really great idea is 90% of the work.

And that if you just tell all these other people, you know, “Here’s this great idea,” then of course they can go off and make it happen.