Skip to content

Instantly share code, notes, and snippets.

Avatar

Seba Kerckhof sebakerckhof

  • Happy Rainbow Factory
  • Belgium
View GitHub Profile
@sebakerckhof
sebakerckhof / array-prototype-partition-proposal.md
Last active Nov 15, 2019
Array.prototype.partition proposal
View array-prototype-partition-proposal.md

Array.prototype.partition proposal

Motivation

Currently there is no way to partition an array into multiple parts based on a callback function, without calling filter multiple times.

const callback = (item) => someCondition;
const matchingItems = arrayToPartition(callback);
View test.cs
// Decompiled with JetBrains decompiler
// Type: ATSx500.Panel.Connection.CommandAndControlSession
// Assembly: ATSx500.Panel.Connection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=12fb96c0395fa3ed
// MVID: A53EC47C-87EB-4DBE-8F95-0E80DF5C83D3
// Assembly location: C:\Program Files\ATS8500 Standalone Downloader\ATSx500.Panel.Connection.dll
using Ace;
using ATSx500.Panel.Connection.Common;
using ATSx500.Panel.Connection.Control;
using ATSx500.Utilities;
@sebakerckhof
sebakerckhof / index.js
Created Nov 28, 2017
requirebin sketch
View index.js
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const glob = require('glob');
var minimatch = require("minimatch")
console.log(glob.hasMagic('/home/seba/dev/home/home-app/.meteor/local/!(db)'));
//console.log(minimatch("/test/foo/d",'/test/foo/!(db)')) // true!
View gist:e84088ad993c04f2944713280f76a04e
0 info it worked if it ends with ok
1 verbose cli [ '/home/seba/.nvm/versions/node/v8.9.0/bin/node',
1 verbose cli '/home/seba/.nvm/versions/node/v8.9.0/bin/npm',
1 verbose cli 'install' ]
2 info using npm@5.5.1
3 info using node@v8.9.0
4 verbose npm-session b8ce224d0333a146
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall edu_proxy@1.2.3-0
7 info lifecycle edu_proxy@1.2.3-0~preinstall: edu_proxy@1.2.3-0
View meteor.sh
#!/bin/sh
# This is the Meteor install script!
#
# Are you looking at this in your web browser, and would like to install Meteor?
#
# MAC AND LINUX:
# Just open up your terminal and type:
#
# curl https://install.meteor.com/ | sh
@sebakerckhof
sebakerckhof / auth-client.js
Created Oct 9, 2015
Meteor patch to fix oauth flow in meteor-tool
View auth-client.js
var auth = require('./auth.js');
var Console = require('../console/console.js').Console;
var ServiceConnection = require('./service-connection.js');
var httpHelpers = require('../utils/http-helpers.js');
exports.AlreadyPrintedMessageError = function () {};
// Opens a DDP connection to a package server. Loads the packages needed for a
// DDP connection, then calls DDP connect to the package server URL in config,
// using a current user-agent header composed by http-helpers.js.
@sebakerckhof
sebakerckhof / output
Created Aug 31, 2015
Meteor 1.2-rc7 refresh loop
View output
Doing HTTP request: POST
https://www.meteor.com/oauth2/authorize?state=60ac0bdac5188c2b7effe3c6757fd0c0&response_type=code&client_id=LdpZEt7ubqXAfkDJ2&redirect_uri=https%3A%2F%2Factivity.meteor.com%2F_oauth%2Fmeteor-developer%3Fclose
|
| files.readFile: 10.5
| files.exists: 2.0
| Rebuild App: 1371.2
| compiler.compile(the app): 23.4
| files.readdir: 1.7
| files.stat: 10.4
| files.realpath: 1.3
@sebakerckhof
sebakerckhof / auth-client.js
Created Jun 29, 2015
Changes to meteor tool
View auth-client.js
var auth = require('./auth.js');
var Console = require('./console.js').Console;
var ServiceConnection = require('./service-connection.js');
var httpHelpers = require('./http-helpers.js');
exports.AlreadyPrintedMessageError = function () {};
// Opens a DDP connection to a package server. Loads the packages needed for a
// DDP connection, then calls DDP connect to the package server URL in config,
// using a current user-agent header composed by http-helpers.js.
@sebakerckhof
sebakerckhof / dabblet.css
Created Dec 13, 2013
Attempt for Chrome-style progress-indicator with SVG and CSS animations
View dabblet.css
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
0% {
stroke: #00aeef
}
37.5% {
stroke: #ed1c24;
@sebakerckhof
sebakerckhof / dabblet.css
Created Dec 13, 2013 — forked from anonymous/dabblet.css
Attempt for Chrome-style progress-indicator with SVG and CSS animations
View dabblet.css
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
0% {
stroke: #00aeef
}
37.5% {
stroke: #ed1c24;