Skip to content

Instantly share code, notes, and snippets.

View juliomenendez's full-sized avatar

Julio Carlos Menendez juliomenendez

View GitHub Profile
@kentcdodds
kentcdodds / README.md
Last active August 9, 2022 09:52
Function syntaxes supported by TypeScript

TypeScript Function Syntaxes

I'm trying to create examples of all the different ways to write functions and function type definitions in TypeScript.

One requirement is these examples must work with strict mode (noImplicitAny, etc) enabled.

If I'm missing anything, please add comments below with examples. I'll eventually put this into a blog post.

@odedw
odedw / .eslintrc.yaml
Last active March 8, 2022 05:27 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
# http:#eslint.org/docs/rules/
ecmaFeatures:
binaryLiterals: false # enable binary literals
blockBindings: false # enable let and const (aka block bindings)
defaultParams: false # enable default function parameters
forOf: false # enable for-of loops
generators: false # enable generators
objectLiteralComputedProperties: false # enable computed object literal property names
objectLiteralDuplicateProperties: false # enable duplicate object literal properties in strict mode
objectLiteralShorthandMethods: false # enable object literal shorthand methods
@wolever
wolever / bp.js
Created November 30, 2015 23:34
bp: a small wrapper to make promises bindable in Angular
ngModule.factory('bp', function() {
return function(q) {
q.state = 'pending';
q.isPending = true;
q.isFulfilled = false;
q.isRejected = false;
q.then(function(result) {
q.state = 'fulfilled';
q.isPending = false;
q.isFulfilled = true;
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@HenrikJoreteg
HenrikJoreteg / simple_function_queue_runner.js
Created July 7, 2010 18:06
Simple function queue runner. Just pass me an array of functions and I'll execute them one by one at the given interval.
// Simple function queue runner. Just pass me an array of functions and I'll
// execute them one by one at the given interval.
run_queue = function (funcs, step, speed) {
step = step || 0;
speed = speed || 500;
funcs = funcs || [];
if (step < funcs.length) {
// execute function
funcs[step]();