Skip to content

Instantly share code, notes, and snippets.

View maletor's full-sized avatar

Ellis Berner maletor

View GitHub Profile
@swlaschin
swlaschin / effective-fsharp.md
Last active March 8, 2024 03:10
Effective F#, tips and tricks

Architecture

  • 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

@ArtiomL
ArtiomL / dbfin.sh
Created May 31, 2016 18:47
dbfin - Unload and Delete the Dropbox OS X Kernel Extension (Project inFinite)
#!/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)"
@killercup
killercup / config.fish
Last active April 12, 2022 03:43
Server Config with fish, vim an tmux
# ~/.config/fish/config.fish
. ~/.config/fish/fish_prompt.fish
set fish_greeting '' # turn off greeting
function fish_title;end
alias vi 'vim'
@maletor
maletor / app.js
Created July 23, 2012 07:09
Bootstrap data using RequireJS and Backbone
require(['userAttributes', 'backbone', 'user_router'], function (config, Backbone, UserRouter) {
var userRouter = new UserRouter() {
userAttributes: userAttributes
};
return router;
});
anonymous
anonymous / heroku_maintenance.rb
Created June 19, 2012 17:52
Heroku Rolling Restarts
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}]"
@guyboltonking
guyboltonking / compressed_static_assets.rb
Created March 21, 2012 20:37
Slightly hacky rails middleware for serving up precompiled gzipped assets
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)
@benfyvie
benfyvie / object_diagnostics.rb
Created December 22, 2011 17:30 — forked from eric/object_diagnostics.rb
Tools for debugging memory bloat using Ruby's built in ObjectSpace
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)
@arirusso
arirusso / img_convert.rb
Created September 30, 2011 16:44
convert html img tags to rails image_tag calls
#!/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***
#