Skip to content

Instantly share code, notes, and snippets.

View nzakas's full-sized avatar
💭
GitHub time is limited currently. Please be patient.

Nicholas C. Zakas nzakas

💭
GitHub time is limited currently. Please be patient.
View GitHub Profile
@nzakas
nzakas / gist:5511916
Created May 3, 2013 17:47
Using GitHub inside a company

I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.

  1. What is the primary setup? Is there an organization and each official repo is owned by that organization?
  2. Does every engineer have a fork of each repo they're working on?
  3. Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
  4. Do engineers work on feature branches on the main repo or on their own forks?
  5. Do you require engineers to squash commits and rebase before merging?
  6. Overall, what is the workflow for getting a new commit into the main repository?
  7. What sort of hooks do you make use of?
  8. Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
@nzakas
nzakas / versioning.md
Created November 24, 2013 23:01
Versioning in a repo

Versioning in a Repository

Lately I've been doing a lot of thinking around versioning in repositories. For all the convenience and ubiquity of package.json, it does sometimes misrepresent the code that is contained within a repository. For example, suppose I start out my project at v0.1.0 and that's what's in my package.json file in my master branch. Then someone submits a pull request that I merge in - the version number hasn't changed even though the repository now no longer represents v0.1.0. The repository is actually now in an intermediate state, in between v0.1.0 and the next official release.

To deal with that, I started changing the package.json version only long enough to push a new release, and then I would change it to a dev version representing the next scheduled release (such as v0.2.0-dev). That solved the problem of misrepresenting the version number of the repository (provided people realize "dev" means "in flux day to day"). However, it introduced a yucky workflow that I really hate

/*
* Pre-ECMAScript 1, JavaScript didn't have native arrays.
* Those who needed them frequently used functions such as the following.
* Also note that there was no special "undefined" value.
*/
function makeArray(len){
var array = new Object();
@nzakas
nzakas / salary.csv
Last active April 21, 2023 10:39
Salary History Table
Year YOE Company State Title Starting $ Ending $ Signing $ Options
2000 0 Radnet, Inc. MA Webmaster $48,000 $55,000 - ?
2001 0 Radnet, Inc. MA UI Developer $62,500 $62,500 - -
2001 0 MatrixOne, Inc. MA UI Designer/Developer $68,000? ? $2,000 ?
2003 3 MatrixOne, Inc. MA Senior Software Engineer ? $75,000? - -
2005 5 Vistaprint, Inc. MA Lead Software Engineer $82,000? $98,000 - 3,000
2006 6 Yahoo, Inc. CA Senior Front-end Engineer $115,000 ? $10,000 3,500
2008 8 Yahoo, Inc. CA Principal Front-end Engineer ? ? - -
2011 11 Yahoo, Inc. CA Presentation Architect ? $165,000? - -
2013 13 Box, Inc. CA Staff Software Engineer $175,000 ? $25,000 50,000
@nzakas
nzakas / type-declarations.js
Created December 14, 2012 22:27
Experiment: Simple way to define types, including prototypal inheritance, in JavaScript
/*
* This is just an experiment. Don't read too much into the fact that these are global variables.
* The basic idea is to combine the two steps of defining a constructor and modifying a prototype
* into just one function call that looks more like traditional classes and other OO languages.
*/
// Utility function
function mixin(receiver, supplier) {
if (Object.getOwnPropertyDescriptor) {
@nzakas
nzakas / techleadbook.md
Created March 20, 2018 20:44
Tech Lead Book

Tech Lead Book

  1. Introduction
  2. What is a Tech Lead?
  3. The Tech Lead Mindset
  4. Becoming a Tech Lead
  5. Working Cross-Functionally
  6. The Art of Delegation
  7. Technical Best Practices
  8. Effective Decision Making
@nzakas
nzakas / arrayproxy.js
Created February 16, 2016 20:46
A proxy that acts like an array
// target is the backing object
let target = { length: 0 },
proxy = new Proxy(target, {
set(trapTarget, key, value) {
let numericKey = Number(key),
keyIsInteger = Number.isInteger(numericKey);
// special case for length property - only need to worry if length is
// shorter than number of array items
@nzakas
nzakas / pancakes.md
Created April 10, 2020 21:47
Pumpkin pancakes

Pumpkin Pancakes Recipe

Ingredients

  • 1/4 cup pumpkin puree
  • 1/4 cup almond milk
  • 1/4 cup water
  • 3 eggs
  • 1 tbsp coconut oil (melted)
  • 1 tsp vanilla
@nzakas
nzakas / alias.md
Created September 11, 2015 17:59
Some simple scripts I use to manage open source branches

Usage:

To create a new branch that is up-to-date with the remote master:

$ ws 123

Creates the branch issue123

@nzakas
nzakas / replace-apache.sh
Created September 14, 2012 00:17
Replace Apache with nginx on Elastic Beanstalk AMI (Tomcat7/32-bit)
#!/bin/sh
# IMPORTANT: Run this script as sudo or else it won't work
# Original script: http://my.safaribooksonline.com/book/programming/java/9781449309558/hacking-elastic-beanstalk/hackingelectric#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODE0NDkzMDk1NTgvSV9zZWN0MTRfZDFlMjAyNQ==
echo 'Installing nginx...sit tight'
yum -y install nginx
echo 'Fixing nginx configuration'
sed -i 's/ 1;/ 4;/g' /etc/nginx/nginx.conf
rm /etc/nginx/conf.d/default.conf