Skip to content

Instantly share code, notes, and snippets.

View basti1302's full-sized avatar

Bastian Krol basti1302

View GitHub Profile
@willurd
willurd / web-servers.md
Last active July 23, 2024 12:11
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mikeal
mikeal / gist:9242748
Last active June 23, 2020 05:17
Response to Nodejitsu NPM Trademark

I've known people at nodejitsu for years, since before the company even existed. I still consider many of them friends. That said, somebody over there has lost their mind.

Trademarks are an important part of open source. They protect the integrity of the trust that is built by any project. A classic example of why this is the case is Firefox. Suppose that a malware producer takes the Firefox codebase, which is free and open source, packages up their malware with it and then releases it as "Firefox". Then they buy search advertising and suddenly their bad and malicious version of Firefox is the first result on search engines across the web. This is clearly a bad thing for Firefox and open source everywhere, but what can Mozilla do to protect their community of users?

They can't enforce a software license since the use is permitted under the Mozilla Public License. They can, however, enforce on these hypothetical bad actors using their trademark on the word "Fi

@bripkens
bripkens / article.md
Last active August 29, 2015 14:16
Cancelable asynchronous operations with Promises

Lets take a look at existing cancelable AngularJS APIs:

$timeout

$timeout can be canceled via $timeout.cancel(promise). To make this possible, a $$timeoutId (source) is registered on the promise. This value is read by the $timeout.cancel(promise) function to actually call clearTimeout(...).

Unfortunately, this is not a good example for cancelable asynchronous operations with Promises.

$timeout returns a promise on which the then(onFulfilled, onRejected) function can be called. This function returns a new promise which does not have a $$timeoutId property and therefore cannot be used to call $timeout.cancel(promise).