Skip to content

Instantly share code, notes, and snippets.

View d4hines's full-sized avatar

Daniel Hines d4hines

View GitHub Profile
@d4hines
d4hines / QueryByAdvancedFind.pq
Last active October 18, 2018 17:35
PowerQuery (M) code to download saved Views/Advanced Finds from Dynamics CRM Web API (8.0 and up)
/*
Downloads Saved View/Advanced Find via Web API
Expand All Columns to access the returned results. Columns prefixed "OData.Community.Display.V1.FormattedValue" show the properly formatted values.
*/
(OrgUrl as text, QueryName as text, LogicalCollectionName as text, UserView as logical) =>
let
GetQueryByName =
(OrgUrl as text, QueryName as text, UserView as logical) =>
let
@d4hines
d4hines / auth.effects.spec.ts
Created July 22, 2017 23:07
Why aren't either of these tests passing?
import { Router } from '@angular/router';
import { TestBed } from '@angular/core/testing';
import { EffectsModule } from '@ngrx/effects';
import { provideMockActions } from '@ngrx/effects/testing';
import { Observable } from 'rxjs/Observable';
import { ReplaySubject } from 'rxjs/ReplaySubject';
import { AuthEffects } from './auth.effects';
@d4hines
d4hines / auth.effects.ts
Created July 24, 2017 14:02
Full Auth Effects for Issue with ngrx/effects
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/exhaustMap';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/take';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/timer';
import { Injectable } from '@angular/core';
@d4hines
d4hines / Clojure.md
Created May 11, 2018 21:10 — forked from joelkuiper/Clojure.md
Job Descriptions

We are looking to hire a skilled Clojure/ClojureScript developer to help build a new platform for medical knowledge. By applying Machine Learning and Natural Language Processing to medical literature, we aim to give experts the insights they need to make informed decisions.

The project is part of Doctor Evidence, a company based in Santa Monica, CA. At this moment a small team is working remotely (GMT+2, EU timezone) on this project as a full-time Research & Development effort.

You will work in a small team that will architect and build the next-generation of data science tools for Evidence Based Medicine and Health Technology Assessment. A good fit would be someone who can work quickly while still following best practices, who thrives on new technology, and has an avid interest in medical informatics and machine learning.

What we offer

  • Flexible work hours from the comfort of your home
@d4hines
d4hines / .joker
Last active June 7, 2018 18:09
Sample Joker Configuration for Fulcro
{:known-macros [[fulcro.client.primitives/defsc [name args]]
[fulcro.client.mutations/defmutation [name args]]
[fulcro.server/defmutation [name args]]
fulcro.client.primitives/defui
[fulcro.client.routing/defrouter [name args]]
[fulcro-spec.suite/def-test-suite [name]]
[fulcro.client.cards/defcard-fulcro [name args]]
fulcro-spec.core/assertions]
:ignored-unused-namespaces [devcards.core]
:rules {:if-without-else true}
@d4hines
d4hines / some.py
Created June 15, 2018 17:57
NTLM to get BID
import requests
from requests_ntlm import HttpNtlmAuth
import json
session = requests.Session()
session.auth = HttpNtlmAuth('DOMAIN\\username', 'password')
url = "https://recruitercrm.regent.edu/CRMRECRUIT/api/data/v8.0/contacts?$filter=datatel_erpid%20eq%20%27B06892407%27"
response = session.get(url)
@d4hines
d4hines / .spacemacs
Created July 6, 2018 12:47
My Spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@d4hines
d4hines / anagram-logic.md
Created August 4, 2018 18:23
Anagram Confusion

function anagrams

  • given an anagram key ak, an initial set of partial angrams pas

    e.g ak = "adeor", pas = #{"a", "are", "dare" ...}

    • For each partial anagram pa in pas,
      • Let key-diff be the multiset difference between pa and ak

        e.g pa = "a", key-diff = "deaor"

Focus
Unfocused
focus -> Focused
Focused*
unfocus -> Unfocused
Tabs
Tab1 Selected*
click tab 2 -> Tab1 Selected
click tab 1 -> Tab1 Selected
@d4hines
d4hines / perfect-squares.cljs
Created March 1, 2019 22:39
Perfect Square Gists
(ns constrained.core
(:require [reagent.core :as reagent]
[goog.dom :as dom]))
(set! *warn-on-infer* true)
(defn collision? [x y w h other-rectangles]
(some
(fn a-collision? [{:keys [left top width height]}]
(and