Skip to content

Instantly share code, notes, and snippets.

View daviddahl's full-sized avatar
💭
burning the midnight oil

David Dahl daviddahl

💭
burning the midnight oil
View GitHub Profile
@daviddahl
daviddahl / github-proof.json
Created October 14, 2018 17:45
Autonomica Proof
{
"handle": "daviddahl",
"ipfsId": "QmRuMAEaUQP6vNBXSCa3FQqVk48t65zA79RsdP5n1sDQg3",
"proof": {
"message": {
"statement": "I am daviddahl on github.com",
"username": "daviddahl",
"service": "github.com"
},
"timestamp": 1539539023189,
@daviddahl
daviddahl / array-sort.js
Created September 28, 2017 18:00
Implement array sort using splice and for
// Using only the Array method Array#splice and the attribute Array#length, please create an array
// that is a unique sorted list given the below two lists.
var assert = require('assert');
var run_tests = function() {
var list1 = [47, 2, 14, 59, 77, 13, 33, 24, 66, 72, 31];
var list2 = [63, 95, 33, 36, 4, 30, 51, 86, 2, 56, 37];
var expected = [
CREATE OR REPLACE VIEW pds_retailer_inventory_latest_vu AS
SELECT a.id,
a.created,
a.updated,
greatest(a.created, a.updated) as last_updated,
(SELECT a.updated WHERE a.retailer_inventory_location_id = l.id ORDER BY a.updated DESC LIMIT 1) as last_inventory_run,
a.sku,
a.available_qty,
a.retailer_inventory_location_id,
l.locator_id,
@daviddahl
daviddahl / plv8-modules.sh
Last active June 22, 2017 02:52
plv8-modules
#! /bin/bash
sudo apt-get install npm
cd /var/django
npm install moment moment-timezone
sudo -u postgres psql -d template1 -c "create extension plv8;"
sudo -u postgres psql -d template1 << EOF
@daviddahl
daviddahl / css-transform-research.md
Last active May 18, 2016 20:50
CSS transform research

CSS transform research

Find, in the relevant standard(s), why the following works in Gecko:

  • elem.style.WebKitTransform

A:

It is difficult to tell from reading the spec why the browser implementations behave the way the do. Outside of the standards process, human decisions around not supporting unstandardized browser functionality and behavior drove the usage of -webkit-* and -moz-*. digging through the mailing lists will no doubt turn up the exact reasons.

For now, the techical reasons are found in code.

@daviddahl
daviddahl / calc-1.sql
Last active May 9, 2016 22:50
sample calc
case
when {{action}} like 'T_%'
then 'Processing...' -- <-- 1st test
when {{listing_location_id}} <> '{{profile.default_participant.location.id}}' -- <-- 2nd test
then 'N/A'
when {{pre_delivery_verify}} = 'Confirm' and {{action}} <> 'Received' <-- 3rd test
then 'Assured'
when {{actor}} = 'Seller' <-- 4th test
then
case
@daviddahl
daviddahl / page-reloading-diagnosis.md
Last active April 22, 2016 16:00
Page reloading Diagnosis

Page Reloading Diagnosis

Examination

  • Watched the console for clues, but found the console constantly re-loading and nearly useless
  • First gut feeling this has something to do with window.location
  • Grabbed all uglified JS files and beuatified them
  • Searched each file for location
@daviddahl
daviddahl / sliding-menu-diagnosis.md
Last active April 24, 2016 04:11
Sliding Menu Diagnosis

Sliding Menu Diagnosis

Examination

  • Watched the console for clues, none forthcoming
  • Examined the CSS and click event handler for obvious coding issues, initially looks good
  • Tinkered with the css a bit based on some related issues found in stackoverflow having to do with display:block in LI and A nodes - was a red herring
  • Created a simpler test case, see: https://gist.github.com/daviddahl/a6740c9310d15452b28fac79cbc93b6a
@daviddahl
daviddahl / simplified-test-case-slider.html
Created April 22, 2016 13:16
SImlified Test Case, slider
<html>
<head>
<style>
.slide{
-webkit-transition:all .2s linear;
-webkit-transform: translate3d(0,0,0);
-moz-transition:all .2s linear;
-moz-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
@daviddahl
daviddahl / configuration.js
Created April 9, 2016 20:10
configuration.js
function () {
/*
* Write Configuration Properties Here:
*/
var PROTO = 'https://';
var HOST = 'dev.nulltxt.se';
var PORT = null;
var API_PATH = 'api/v1/';