Skip to content

Instantly share code, notes, and snippets.

View zenweasel's full-sized avatar
🏠
Working from home

Brent Hoover zenweasel

🏠
Working from home
View GitHub Profile

Eight Verses of Training the Mind

by Geshe Langri Thangpa

  1. By thinking of all sentient beings As more precious than a wish-fulfilling jewel For accomplishing the highest aim, I will always hold them dear.

  2. Whenever I’m in the company of others, I will regard myself as the lowest among all,

CREATE OR REPLACE FUNCTION insta5.next_id(OUT result bigint) AS $$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
now_millis bigint;
shard_id int := 5;
BEGIN
SELECT nextval('insta5.table_id_seq') %% 1024 INTO seq_id;
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()) * 1000) INTO now_millis;
import fs from "fs";
import { Blob } from "buffer";
import { Readable } from "stream";
import pkg from "@reactioncommerce/file-collections";
// import * as buffer from "buffer";
global.Blob = Blob;
const { FileRecord } = pkg;
# If a mirror repo is set up properly this will pull from the source repo
# and push to the mirror
# https://help.github.com/en/articles/duplicating-a-repository
git fetch -p origin
git push --mirror

Keybase proof

I hereby claim:

  • I am zenweasel on github.
  • I am zenweasel (https://keybase.io/zenweasel) on keybase.
  • I have a public key whose fingerprint is C6AE 7DA7 2837 C999 D311 720B 16EA 4EB1 5D65 9E6C

To claim this, I am signing this object:

@zenweasel
zenweasel / general_lib.txt
Created October 29, 2012 14:31 — forked from matthusby/general_lib.erl
Common Erlang Functions
-module(general_lib).
-compile(export_all).
-define(SECRET, "SOMETEXTHERE").
time_as_string() ->
{MegaSeconds, Seconds, MicroSeconds} = erlang:now(),
integer_to_list(MegaSeconds) ++ integer_to_list(Seconds) ++ integer_to_list(MicroSeconds).
time_as_seconds() ->
@zenweasel
zenweasel / showSubs.js
Created March 7, 2016 00:22
snippet for logging all subscriptions
let subs = Meteor.default_connection._subscriptions; // all the subscriptions that have been subscribed.
Object.keys(subs).forEach(function(key) {
console.log(subs[key]); // see them in console.
});

Product test plan

Products grid

Non-admin user

Product Card display

  • Card should display Sold Out! label when inventory qty < min.inventory qty, but only if "Inventory Tracking" option is enabled.
  • if any product's variant.inventoryQuantity <= variant.lowInventoryWarningThreshold the card should display Limited Supply
  • if any product's !variant.inventoryManagement || variant.inventoryQuantity > 0 display Backorder
  • a product card should display a range of pricing from the lowest variant price to the highest variant price.
@zenweasel
zenweasel / dynamicMapping.java
Created January 20, 2014 15:19
Dynamic Mapping
private void loadRules(Map<String, Object> rules, ResultSet results) throws SQLException {
// create map to hold results
while(results.next()) {
DataType dataType
= new ReferenceTableEntryFactory<DataType>().createFromCode(results.getInt(4), DataType.values());
switch (dataType) {
case Boolean:
rules.put(results.getString(3), results.getBoolean(6));
break;
case TinyInt: