Skip to content

Instantly share code, notes, and snippets.

View citizen428's full-sized avatar

Michael Kohl citizen428

View GitHub Profile
@wulab
wulab / hotfix.sh
Last active August 29, 2015 14:10
A way to get hotfix branch to master when staging has pending commits
# backup current staging
$ git checkout staging
$ git branch tmp
# reset to master and merge hotfix
$ git reset --hard master
$ git merge hotfix/xxx
$ git push --force origin staging
# deploy to production
@justdoit0823
justdoit0823 / golang_essence.md
Last active August 22, 2018 07:08
Golang essence.

Code organization

Overview

  • Go programmers typically keep all their Go code in a single workspace.
  • A workspace contains many version control repositories (managed by Git, for example).
  • Each repository contains one or more packages.
@weavejester
weavejester / gist:1001206
Created May 31, 2011 20:27
Clojure on Heroku
~/$ lein new ring-on-heroku
Created new project in: /home/jim/Development/ring-on-heroku
~/$ cd ring-on-heroku
~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile
~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj
(ns ring-on-heroku.core
(:use ring.util.response
ring.adapter.jetty))
(defn app [req]
@deanrad
deanrad / has_many_perils.md
Last active July 10, 2019 19:00
has_many is a lie

has_many is a SOLID violation

TL;DR has_many is an anti-pattern which leads straight to monolithic applications.

First - what defines a monolithic application? It is one that cannot be split apart because everything depends on everything else. No part can be extracted to an external library - the library would have to be the size of our entire app. Let this be our working definition of a monolith. Ignore, for the moment, whether it's deployed on more than one machine, but ask could it be separated if you desired.

One major culprit of not being able to split an application up is a dependency cycle.

Feedback loop

@Lysxia
Lysxia / Binary.hs
Created February 26, 2020 20:33
Binary pattern-matching on bytestrings
{-# LANGUAGE
ScopedTypeVariables,
ViewPatterns,
PatternSynonyms #-}
import Data.Bits (Bits, shift)
import Data.Word
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B8
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@IvanIvanoff
IvanIvanoff / pre-commit
Last active October 23, 2022 07:48
pre-commit hook for checking mix formatting
#!/bin/bash
cd `git rev-parse --show-toplevel`
echo "Running pre-commit hook: Check elixir formatting with mix format"
mix format --check-formatted
if [ $? == 1 ]; then
echo "mix format --check-formatted found formatting issues."
exit 1
fi
@enerqi
enerqi / fsharp-fable-tips.md
Last active April 11, 2023 14:41
Fable F# Notes

Basic Tooling Setup

Fable is an F# language to javascript compiler powered by Babel.

F# is a language that runs on a Microsoft CLR. Using the .NET Core CLR implementation it works on Windows, Mac or Linux.

F# Linux

  • .NET Core SDK - download the latest 2.1 SDK
  • Mono - mono-complete package
  • F# compiler - fsharp package from the mono repository
@ruediger
ruediger / attributes
Last active August 16, 2023 00:47
A collection of additional "custom hunk header" patterns for .gitattributes. This provides better context in the diff hunk header.
*.tex diff=tex
*.bib diff=bibtex
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
*.cpp diff=cpp
*.hpp diff=cpp
*.cc diff=cpp
*.hh diff=cpp
@tpope
tpope / .gitattributes
Created October 24, 2010 20:38
Fewer conflicts in your Rails apps
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema