Skip to content

Instantly share code, notes, and snippets.

Greg Smith incompl

Block or report user

Report or block incompl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@incompl
incompl / gist:3819571
Last active Nov 22, 2019
Git needs help
View gist:3819571

The git command-line interface sucks

When I use git, I'm scared I'll break something. I just talked to an open source celebrity who has used git for 3-4 years who avoids using the CLI because he's afraid he'll break something, and uses Tower when possible. I recently had a client accidentally delete their work because they didn't understand git. My fear of breaking something is well-founded.

You can't put a price on the confidence that source control is supposed to give you. That confidence suffers when people are afraid of causing irreparable damage during normal use.

This article lists a few ideas on what git can do to improve.

A Controlled Vocabulary

View gist:4163682
gravity = new b2Vec2(0,9.8),
world = new b2World,gravity,true)
View gist:7896479
Greg Smith:
dogs are eggs
Pete Karl II:
"Land seals"
Greg Smith:
dogs are animals who bark, sometimes. you can’t really say that in general because some dogs who bark aren’t dogs
Pete Karl II:
Barking happens most times.
Greg Smith:
dogs are eggs, but also they lay eggs
View gist:7585741
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
options.username = 'greg';
options.password = 'foo';
});
View styleguide.md

Greg's CSS Styleguide

A fork of a CSS styleguide starting point

Terminology

/* this whole thing is a rule */
selector {
  property: value; /* this line is a declaration */
}
@incompl
incompl / css.style.md
Last active Dec 28, 2015
A Starting Point for CSS Styleguides
View css.style.md

A Starting Point for CSS Styleguides

This is a CSS styleguide that you could fork to use for your project. Some of the rules give you multiple acceptable options. If you want to adopt this styleguide for your project, you should modify it for your project.

Here is an example styleguide made from this starting point

This styleguide follows my styleguide for styleguides. That means it follows the following rules:

  • Focus on readability.
  • Focus on consistency.
View thermorules.md

Thermostat Rules

Minimum Temperature: 60 Maximum Temperature: 75 Position of swtich: Always Off

What do if the room I'm in is too hot/cold:

Change the temperature such that it continues to abide by the rules.

View gist:7104375
var games = {};
io.sockets.on('connection', function(socket) {
var id = socket.id;
var game = games[id];
if (game === undefined) {
game = new MyGame();
games[id] = game;
}
View gist:7104384
cloak.configure({
// New users go to the lobby, a special
// room that exists by default.
autoJoinLobby: true,
// Create a new room automatically when there are
// enough users in the lobby. Users are added
// to the new room when it's created.
autoCreateRooms: true,
View gist:7104381
var waiting = null;
var games = {};
io.sockets.on('connection', function(socket) {
var id = socket.id;
var game = games[id];
if (game === undefined) {
if (waiting !== null && waiting !== id) {
game = new MyGame();
You can’t perform that action at this time.