Skip to content

Instantly share code, notes, and snippets.

@domenic
domenic / promises.md
Last active June 24, 2024 03:11
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@mwalters
mwalters / jquery-crash-course.md
Last active May 30, 2024 08:26
A friend needed a crash course in jQuery basics. I thought it might be helpful to capture it. Feel free to suggest corrections / modifications / additions.

Ok, crash course in jQuery and stuff:

Accessing jQuery

jQuery makes a global object, typically referenced by "$". There's also something called no-conflict mode where you'd reference it by "jQuery", but you won't see that too often in what we're doing, but just in case you encounter it, essentially these are the same:

$('.article')
jQuery('.article')

Element Selection

@brandon1024
brandon1024 / GITCRASHCOURSE.MD
Last active June 27, 2024 11:27
Git Crash Course for Beginners

Git Crash Course for Beginners

Preface

A good understanding of Git is an incredibly valuable tool for anyone working amongst a group on a single project. At first, learning how to use Git will appear quite complicated and difficult to grasp, but it is actually quite simple and easy to understand.

Git is a version control system that allows multiple developers to contribute to a project simultaneously. It is a command-line application with a set of commands to manipulate commits and branches (explained below). This tutorial will help you get started, and in no time you will be a Git Ninja!

Contents:

@DevoKun
DevoKun / kafka.md
Created July 13, 2018 02:52
How to operate Kafka, mostly using Docker

Kafka Distributed Streaming Platform

Publish and Subscribe / Process / Store

Start Kafka

  • Kafka uses ZooKeeper as a distributed backend.

Start Zookeeper

History:
--all searches over the entire repository instead of only in the current branch
- git log --oneline (compressed, one line for commit)
- git log --grep <regex> (searches for commits with the given regex expression in their message)
- git log -Smysearchstring (searches for all the commits that contain any change for mysearchstring in this branch, that is, it looks at
files contents, not to commit messages.)
- git log --pretty=format:"%Cgreen%h %Cred%cn %Cblue%s"
  - git log --pretty=format:"%<|(20) %Cgreen%h %Cred%cn %Cblue%s" (with column)