Skip to content

Instantly share code, notes, and snippets.

@pbc
pbc / esm-package.md
Created June 13, 2024 13:46 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@pbc
pbc / flann.patch
Created September 10, 2016 15:58 — forked from patricksnape/flann.patch
Fixes #5667
--- modules/features2d/src/matchers.cpp
+++ modules/features2d/src/matchers.cpp
@@ -517,30 +517,32 @@ DescriptorMatcher::~DescriptorMatcher()
void DescriptorMatcher::add( InputArrayOfArrays _descriptors )
{
- if(_descriptors.isUMatVector())
+ if( _descriptors.isUMatVector() )
{
std::vector<UMat> descriptors;
@pbc
pbc / sift_match.rb
Created August 26, 2016 13:20 — forked from satojkovic/sift_match.rb
image matching using SIFT
#!/usr/bin/env ruby
require 'rubygems'
require 'rmagick'
include Math
class KDTreeNode
attr_accessor :data, :left_child, :right_child
[Unit]
Description=App Redis Sidekick
Requires=docker.service
Requires=etcd.service
After=docker.service
After=etcd.service
After=app-redis.service
BindsTo=app-redis.service
# kernel 3.4 running on Hp Pavilion 14-c002sa, 32bit architecture
#!/bin/bash
set -x
#
# Grab verified boot utilities from ChromeOS.
#
mkdir -p /usr/share/vboot
@pbc
pbc / gist:5501259
Last active December 16, 2015 21:39
class OnlineJob
attr_accessor :dev_kit, :environment, :perks, :my_skills
def apply
STDOUT.puts "there be dragons!!!"
end
end
class RubyDeveloper
@pbc
pbc / gist:4147438
Created November 26, 2012 09:51
test queries - orientdb floats, doubles, decimals SQL INSERT issues
drop class FooBar;
create class FooBar;
CREATE PROPERTY FooBar.float_value FLOAT;
CREATE PROPERTY FooBar.double_value DOUBLE;
CREATE PROPERTY FooBar.decimal_value DECIMAL;
# VERY SMALL VALUES
# lowercase "e" and no "d" after the double_value
insert into FooBar(float_value, double_value, decimal_value) values (1.40129846432481707e-45, 4.94065645841246544e-324, 0.00000000000000000000000000000000000000000000000000098134123412341234);
@pbc
pbc / gist:4147431
Created November 26, 2012 09:48
orientdb floats, doubles, decimals SQL INSERT issues
orientdb> drop class FooBar;
Removed class in 0.023000 sec(s).
orientdb> create class FooBar;
Class created successfully. Total classes in database now: 21
orientdb> CREATE PROPERTY FooBar.float_value FLOAT;
Property created successfully with id=1
orientdb> CREATE PROPERTY FooBar.double_value DOUBLE;
Property created successfully with id=2
orientdb> CREATE PROPERTY FooBar.decimal_value DECIMAL;
Property created successfully with id=3
@pbc
pbc / browser
Created June 14, 2012 09:55 — forked from defunkt/browser
pipe html to a browser
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo '<h1>hi mom!</h1>' | browser
# $ ron -5 man/rip.5.ron | browser
BROWSER=/usr/bin/firefox