Skip to content

Instantly share code, notes, and snippets.

View kurtisdunn's full-sized avatar

Kurtis Dunn kurtisdunn

View GitHub Profile
@kurtisdunn
kurtisdunn / readme.md
Last active November 27, 2015 11:02
Use Twig Template stuff

Useful TWIG stuff for Drupal 8

@kurtisdunn
kurtisdunn / readme.md
Last active January 6, 2016 06:23
BackboneJS Sort Collection asc/desc

####BackboneJS Sort Collection asc/desc

@kurtisdunn
kurtisdunn / post.json
Last active December 9, 2015 05:57
Drupal 8 REST POST Requests
//Create a new forum topic
http://d8.dev:3000/entity/node?_format=hal_json
{
"_links": {
"type": {
"href": "http://d8.dev/rest/type/node/forum"
}
},
@kurtisdunn
kurtisdunn / forums.md
Last active January 6, 2016 06:24
Drupal 8 Forums with REST

##Drupal 8 REST End Points and Examples

Headers

####POST to Forums

@kurtisdunn
kurtisdunn / README.md
Created January 6, 2016 07:01
FizzBuzz

####FizzBuzz.js

@kurtisdunn
kurtisdunn / comparison.md
Created January 16, 2016 00:55 — forked from makmanalp/comparison.md
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).

@kurtisdunn
kurtisdunn / classes.js
Created February 8, 2016 05:12
Pure JS ClassList manipulation
Element.prototype.hasClass = function (className) {
return new RegExp(' ' + className + ' ').test(' ' + this.className + ' ');
};
Element.prototype.addClass = function (className) {
if (!this.hasClass(className)) {
this.className += ' ' + className;
}
return this;
};
@kurtisdunn
kurtisdunn / active_directory.md
Last active May 2, 2019 23:20
active_directory.ps
  
#Set the ExecutionPolicy to allow execution of scripts

Set-ExecutionPolicy Unrestricted


#Connect to your Domain Controller(DC)
#Change the value after the -ComputerName to your know DC
@kurtisdunn
kurtisdunn / desc.md
Last active August 26, 2018 04:12
React Form Component

React Form Component

Forms need to be able to pass state to deeply nested children, specifically validation state. You will need map React.Children in order to setState for each child. Unfortunately this doesn't solve the problem of of deeply nested inputs. In order to combat this we will need to use a recursive function to check against each nested level to see if it has an input for validation.

  function recursiveCloneChildren(children) {
    const that = this;
    return React.Children.map(children, child => {
 var childProps = {};
@kurtisdunn
kurtisdunn / desc.md
Last active August 26, 2018 05:01
Scroll To Function JS

Scroll To Top - Vanilla Javacript