Skip to content

Instantly share code, notes, and snippets.

View niemyjski's full-sized avatar
😀

Blake Niemyjski niemyjski

😀
View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active April 19, 2024 18:00
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@projectpwr
projectpwr / commit-msg
Created September 24, 2016 18:21
git commit-msg hook to prepend jira ticket number to commit messages...
#!/bin/sh
# hook identifies jira ids in branch names, adds on more goodies if we are a hotifx or release branch and attempts to prevent blank commit messages...although this needs a bit more work...
COMMIT_FILE=$1
COMMIT_MSG=$(cat $1)
#First and foremost check whether the commit message is blank. if so then abort the commit. strip any spaces out too
#this one only works at present when someone tries to do git commit -m "" or git commit -m " "
#if anyone uses tools such as sourcetree, then these GUIs typically present a prompt...eg. "do you want to commit wihtout a message" and pass in optional attributes to git commit to allow this.
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@niemyjski
niemyjski / DiagnoseRedisErrors-ClientSide.md
Created July 19, 2016 11:36 — forked from JonCole/DiagnoseRedisErrors-ClientSide.md
Diagnosing Redis errors caused by issues on the client side

Diagnosing Redis errors on the client side

Customers periodically ask "Why am I getting errors when talking to Redis". The answer is complicated - it could be a client or server side problem. In this article, I am going to talk about client side issues. For server side issues, see here

Clients can see connectivity issues or timeouts for several reason, here are some of the common ones I see:


###Memory pressure

@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@bmhatfield
bmhatfield / .profile
Last active March 18, 2024 07:43
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@niemyjski
niemyjski / CLA.md
Last active May 30, 2017 13:22
Exceptionless Contributor License Agreement

Exceptionless Contributor License Agreement

The document below clarifies the terms under which You (the copyright owner or legal entity authorized by the copyright owner), may make “The Contributions” (software, bug fixes, configuration changes, documentation, or any other materials) to “The Work” (Exceptionless/Exceptionless). This license protects You, “The Company” (Exceptionless) and licensees; it does not change your rights to use your own contributions for any other purpose.

Please complete the following information about You and The Contributions. If you have questions about these terms, please contact us at team@exceptionless.com.

You and “The Company” (Exceptionless) agree:

  1. You grant to “The Company” (Exceptionless) a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, relicenseable, transferable license under all of Your relevant intellectual property rights, to use, copy, prepare derivative works of, distribute and publicly perform and display “The Contributions”
@vasanthk
vasanthk / System Design.md
Last active April 19, 2024 15:40
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@need12648430
need12648430 / display.js
Last active September 1, 2015 16:59
Maze Generator in 532 bytes.
// only semi-golfed, mostly because i was in the headspace; only used for debugging
var w, h, x, y, m=maze(w=16,h=16), g=[];
// generate fully walled grid
for(y = 0; y < h * 2 + 1; y ++) {
g[y]=[]
for(x = 0; x < w * 2 + 1; x ++)
g[y].push(!(y&1)?"#":!(x&1)?"#":" ");
}
@niemyjski
niemyjski / plugin.example.cs
Last active August 29, 2015 14:15
Exceptionless Plugin Example
// There are two ways to create an plugin:
public class UniqueUserIdentifierPlugin : IEventPlugin {
public void Run(EventPluginContext context) {
if (!ctx.Client.Configuration.IncludePrivateInformation)
return;
// Only update it if it's not currently set.
var user = context.Event.GetUserIdentity();
if (user != null)