Skip to content

Instantly share code, notes, and snippets.

View cerebrl's full-sized avatar

Justin Lowery cerebrl

View GitHub Profile
@jamischarles
jamischarles / git_commands.sh
Last active March 14, 2019 13:07
Git cheat sheet
- my normal flow?
- good commit messages ******
- searching commit messages (group by keywords)
- searching code *
- working with history (viewing, time traveling)
- rebasing (for pulling & squashing, splitting a commit) *
- undoing local commits (soft, hard reset)
- forgot to add / change message (amend)
- LOST commits? *
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

// DISCLAIMER: This is not necessarily good code. It’s just code that I wrote
// as quickly as possible to do each task.
// 1
return 2*i;
// 2
return !(i%2);
@bennadel
bennadel / angularjs-errors.htm
Created October 3, 2013 13:56
Logging Client-Side Errors With AngularJS And Stacktrace.js
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Logging Client-Side Errors With AngularJS And Stacktrace.js
</title>
<style type="text/css">
@tbranyen
tbranyen / problem.md
Last active December 19, 2015 22:59

I have a list of components that are dynamically bound to a parent region via region.components. This is an array that is rendered via ng-repeat. Since they are polymorphic and arbitrary, but all share the same base, I've created a base component directive. However, I want to hook (by component id) a directive up to the same component item. Since the property is dynamically evaluated the second directive never hooks into it.

First attempt:

@cowboy
cowboy / eval-is-evil.js
Last active May 12, 2020 11:56
A JavaScript "eval is evil" narrative by way of the "pass a string to setTimeout" anti-pattern...
// An object with a property and a method.
var obj = {
name: "Ben",
logName: function() {
console.log(this.name);
}
};
// And another global variable, for good measure.
var name = "Whoops";
@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.