Skip to content

Instantly share code, notes, and snippets.

View anodynos's full-sized avatar

Angelos Pikoulas anodynos

  • Freelancer
  • London, UK
View GitHub Profile
@caseywatts
caseywatts / 0-self-publishing.md
Last active May 2, 2024 06:04
Self-Publishing via Markdown
@bortexz
bortexz / ngrxintro.md
Created January 10, 2017 11:21 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@KiaraGrouwstra
KiaraGrouwstra / proxy-promise.js
Created August 21, 2016 16:00
using ES6 Proxy to deal with methods of Promise'd objects. not sure how useful this is yet.
// using ES6 Proxy to deal with methods of Promise'd objects. works for me in Edge though not Chrome somehow.
let handler = {
get: (target, prop) => function() {
if(target instanceof Promise) {
let args = arguments;
return target.then((o) => o[prop].apply(o, args));
} else {
let value = target[prop];
return typeof value == 'function' ? value.bind(target) : value;
}
@unscriptable
unscriptable / AMD-factory-with-require.js
Created November 20, 2012 15:11
Simple AMD/node boilerplate. These aren't quite "normal" AMD and aren't "pure" CJS, but work in AMD loaders and node-like environments (like RingoJS).
// Typical AMD factory that returns a value, but uses an r-value (sync) require(),
// rather than a long, awkward dependency list.
// You cannot use module.exports or exports to declare the module:
(function (define){
define(function (require) {
"use strict";
var mod = require('pkb/modA');
return {
@domenic
domenic / promise-retryer.js
Last active September 16, 2023 02:43
Generalized promise retryer
"use strict";
// `f` is assumed to sporadically fail with `TemporaryNetworkError` instances.
// If one of those happens, we want to retry until it doesn't.
// If `f` fails with something else, then we should re-throw: we don't know how to handle that, and it's a
// sign something went wrong. Since `f` is a good promise-returning function, it only ever fulfills or rejects;
// it has no synchronous behavior (e.g. throwing).
function dontGiveUp(f) {
return f().then(
undefined, // pass through success
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh