Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar
🦄
Proverbs 3:21

Wil (₩) Moore III wilmoore

🦄
Proverbs 3:21
View GitHub Profile
@RobertFischer
RobertFischer / Description.md
Last active October 14, 2023 16:47
Benchmarking is Hard, Yo.

So, I was reading Why You shouldn’t use lodash anymore and use pure JavaScript instead, because once upon a time, I shifted from Underscore to Lodash, and I'm always on the lookout for the bestest JavaScript stdlib. At the same time, there was recently an interesting conversation on Twitter about how some of React's functionality can be easily implemented in modern vanilla JS. The code that came out of that was elegant and impressive, and so I have taken that as a message to ask if we really need the framework.

Unfortunately, it didn't start out well. After copy-pasting the ~100 lines of code that Lodash executes to perform a find, there was then this shocking claim: Lodash takes 140ms, and native find takes 0ms.

@codefromthecrypt
codefromthecrypt / opentracing-zipkin.md
Last active October 27, 2021 01:44
My ramble on OpenTracing (with a side of Zipkin)

I've had many people ask me questions about OpenTracing, often in relation to OpenZipkin. I've seen assertions about how it is vendor neutral and is the lock-in cure. This post is not a sanctioned, polished or otherwise muted view, rather what I personally think about what it is and is not, and what it helps and does not help with. Scroll to the very end if this is too long. Feel free to add a comment if I made any factual mistakes or you just want to add a comment.

So, what is OpenTracing?

OpenTracing is documentation and library interfaces for distributed tracing instrumentation. To be "OpenTracing" requires bundling its interfaces in your work, so that others can use it to time distributed operations with the same library.

So, who is it for?

OpenTracing interfaces are targeted to authors of instrumentation libraries, and those who want to collaborate with traces created by them. Ex something started a trace somewhere and I add a notable event to that trace. Structure logging was recently added to O

F#C#ScalaClojurePythonRubyHaskellSQLOCamlCommon LispErlangSmalltalkSchemeEcmascript 5Perl 5
mapSelectmapmapmapcollectmapSelectmapmapcarmapcollect:mapmapmap
filterWherefilterfilterfilterselectfilterWherefilterremove-if-notfilterselect:filterfiltergrep
foldAggregatefoldLeftreducereduceinjectfoldl
var org = '<organization to fork to (or undefined>'
var token = '<your token here>'
function options(host) {
return {
host: host || undefined,
auth: {
type: 'oauth',
token: token
}
@getify
getify / gist:5226305
Last active January 7, 2024 11:59
playing around with an `Object.make()` helper
// `Object.make(..)` is a helper/wrapper for `Object.create(..)`. Both create a new
// object, and optionally link that new object's `[[Prototype]]` chain to another object.
//
// But `Object.make(..)` makes sure the new object always has a `__proto__` property
// (even a null one) and delegation to a `isPrototypeOf(..)` method, both of which are
// missing from the bare object (aka "Dictionary") created by `Object.create(null)`.
//
// `isPrototypeOf()` is put on a extra object that your created object can delegate to,
// if any only if you create an empty object (by not passing a `linkTo`) that otherwise
// wouldn't have access to `isPrototypeOf()`.
@creationix
creationix / hidepatch.js
Created March 20, 2013 16:24
Idea to make private properties and methods non-enumerable instead of prefixing them with underscores (in ES5 and above environments of course)
Object.defineProperty(Object.prototype, "hide", {
value: function () {
[].forEach.call(arguments, function (name) {
var descriptor = Object.getOwnPropertyDescriptor(this, name);
if (descriptor.enumerable) {
descriptor.enumerable = false;
Object.defineProperty(this, name, descriptor);
}
}, this);
}
@asciidisco
asciidisco / getTitle.js
Created January 31, 2013 16:19
Access PhantomJS via WebDriver/JSONWireProtocol from node to receive the title of a webpage
// before you launch this script, make sure you have phantomjs v1.8 installed
// and launch it with the port specified in the options: ´$ phantomjs --webdriver=3456´
var http = require('http');
// request body for "/wd/hub/session" request
var body = JSON.stringify({desiredCapabilities: {browserName: 'firefox', version: '', platform: 'ANY'}});
// base options for post requests
var options = {
#!/bin/sh
#
# Usage: git semver-tags [-p|--pre]
#
# Lists semver tags in the repository in order from newest to oldest.
#
# Useful for e.g. programmatically finding the latest release tag:
# `git semver-tags | head -n 1`.
#
# Tag names must be valid according to the SemVer 1.0.0 specification
@wilmoore
wilmoore / icon-codes.md
Created December 6, 2012 19:11
Github Comment Icon Codes (Markdown)

👍:+1:

👎:-1:

💯:100:

🔢:1234:

🎱:8ball:

@wilmoore
wilmoore / 01_filter_sort.php
Last active October 12, 2015 03:58
Filter and Sort (least concise and enjoyable to write from the top, to the most concise and enjoyable at the bottom)
<?php
$fields = array('firstName', 'middleName', 'lastName', 'suffix');
$names[] = array('firstName' => 'Diane ', 'middleName' => 'Tanya ', 'lastName' => ' Douglas', 'suffix' => '');
$names[] = array('firstName' => 'Jon ', 'middleName' => '', 'lastName' => ' Watson', 'suffix' => '');
$names[] = array('firstName' => ' Michelle ', 'middleName' => '', 'lastName' => ' Ajuria', 'suffix' => '');
$names[] = array('firstName' => 'Elliot ', 'middleName' => '', 'lastName' => 'Gray ', 'suffix' => 'II');
$names[] = array('firstName' => ' Jason ', 'middleName' => '', 'lastName' => 'Doran', 'suffix' => '');
// drop superfluous spaces and empty name parts (i.e. if there is no middle name, get rid of it)
$names = array_map(function($name) {