Skip to content

Instantly share code, notes, and snippets.

View Destitute-Streetdwelling-Guttersnipe's full-sized avatar
🎯
Focusing

DSG (Destitute Streetdwelling Guttersnipe) Destitute-Streetdwelling-Guttersnipe

🎯
Focusing
View GitHub Profile
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@egeorjon
egeorjon / add_remove_class_with_js.md
Last active October 13, 2023 23:06
Add or Remove css class with Javascript

From: StackOverflow

To change all classes for an element:

document.getElementById("MyElement").className = "MyClass";

To add an additional class to an element:

document.getElementById("MyElement").className += " MyClass";

To remove a class from an element:

@amitsaha
amitsaha / ls.rst
Last active June 6, 2024 04:01
How does `ls` work?

How does ls work?

I wanted to be really able to explain to a fair amount of detail how does the program :command:`ls` actually work right from the moment you type the command name and hit ENTER. What goes on in user space and and in kernel space? This is my attempt and what I have learned so far on Linux (Fedora 19, 3.x kernel).

How does the shell find the location of 'ls' ?

@CoolOppo
CoolOppo / Vim Commands Cheat Sheet.md
Created February 5, 2014 20:47
Vim Commands Cheat Sheet

Source

Vim Commands Cheat Sheet


How to Exit

:q[uit]

@egel
egel / auto-remove-sublime-license-popup
Last active November 5, 2024 21:28
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)
@tracker1
tracker1 / 01-directory-structure.md
Last active November 8, 2024 21:10
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@joepie91
joepie91 / .md
Last active June 25, 2023 09:15
Error handling (in Node.js, with promises)

There's roughly three types of errors:

  1. Expected errors - eg. "URL is unreachable" for a link validity checker. You should handle these in your code at the top-most level where it is practical to do so.
  2. Unexpected errors - eg. a bug in your code. These should crash your process (yes, really), they should be logged and ideally e-mailed to you, and you should fix them right away. You should never catch them for any purpose other than to log the error, and even then you should make the process crash.
  3. User-facing errors - not really in the same category as the above two. While you can represent them with error objects (and it's often practical to do so), they're not really errors in the programming sense - rather, they're user feedback. When represented as error objects, these should only ever be handled at the top-most point of a request - in the case of Express, that would be the error-handling middleware that sends a HTTP status code and a response.

Would I still need to use try/ca

@joepie91
joepie91 / mongodb.md
Last active June 25, 2023 09:13
Why you should never, ever, ever use MongoDB.

This post has moved here.

@joepie91
joepie91 / flatten.js
Last active June 25, 2023 09:12
Flatten array with promises
module.exports = function(array) {
return array.reduce(function(total, subArray) {
subArray.forEach(function(item) {
total.push(item);
});
return total;
}, []);
}