-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
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 | |
# dbfin - Unload and Delete the Dropbox OS X Kernel Extension (Project inFinite) | |
# (CC0) No Rights Reserved | |
# Artiom Lichtenstein | |
# v1.1, 31/05/2016 | |
set -u | |
fun_ECHOLOR() { | |
echo -e "$(tput setaf $2)$(tput bold)$1$(tput sgr0)" |
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
# ~/.config/fish/config.fish | |
. ~/.config/fish/fish_prompt.fish | |
set fish_greeting '' # turn off greeting | |
function fish_title;end | |
alias vi 'vim' |
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
require(['userAttributes', 'backbone', 'user_router'], function (config, Backbone, UserRouter) { | |
var userRouter = new UserRouter() { | |
userAttributes: userAttributes | |
}; | |
return router; | |
}); |
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
class HerokuMaintenance | |
def self.rolling_restarts | |
puts "Processing Rolling Restarts" | |
processes = time_hash[Time.now.hour] | |
if processes | |
puts "restarting: #{processes.inspect}" | |
processes.each { |process| restart_process(process) if process} | |
else | |
puts "No restarts scheduled for hour: [#{Time.now.hour}]" |
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
require 'action_dispatch/middleware/static' | |
module Middleware | |
class FileHandler < ActionDispatch::FileHandler | |
def initialize(root, assets_path, cache_control) | |
@assets_path = assets_path.chomp('/') + '/' | |
super(root, cache_control) | |
end | |
def match?(path) |
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
module ObjectDiagnostics | |
extend self | |
#This is handy when you want to determine what types of objects are contributing to memory bloat | |
#returns the change in object counts since the last time this method was called | |
def change_in_object_counts | |
#this will start all counts at 0 for the initial run | |
@previous_counts ||= Hash.new(0) |
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
#!/usr/bin/env ruby | |
require "nokogiri" | |
# opens every file in the given dir tree and converts any html img tags to rails image_tag calls | |
# | |
# example usage: | |
# ruby convert.rb ~/my_rails_app/app/views | |
# | |
# ***be careful and backup before using this*** | |
# |
NewerOlder