Skip to content

Instantly share code, notes, and snippets.

@dcorns
dcorns / combine-sets
Created May 17, 2017 01:24
sum the values of a given array of objects sorted by a given property to sort on and the property containing the values to sum
/**
* combine-sets
* Created by dcorns on 5/16/17
* Copyright © 2017 Dale Corns
* MIT Licensed
*/
'use strict';
const data = [
{
"paid_savings": 8841.88,
@dcorns
dcorns / designer.html
Last active August 29, 2015 14:23
designer
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
@dcorns
dcorns / FedoraWebDevSetup
Last active March 13, 2023 14:01
One way to setup Fedora distro for Web Development
Fedora Setup Notes
1) If you did not make yourself an administrator during the install, Add yourself to etc/sudoers using the command visudo (allows user to authenticate own account for operations requiring root).
a) su, enter root password when prompted
b) visudo (use vi for sudo to edit the file following instructions in the file; either add self as a sudo user or enable a group for sudo user and add your self to that group using user group commands)
c) ctrl-D (exit root access)
d) logout and log back in or restart
e) Now you should be able to respond to any prompt requiring root with your own login credentials and be able to run commands using sudo with your own credentials.
2) Google Chrome Setup
@dcorns
dcorns / arrayToBST.js
Last active August 29, 2015 13:57
Recursion method for converting a sorted array to a binary tree
var arrayToBST = function(ary){
//make return object here for simple manipulation
bt = {};
//encapsulate start functions within validation
//validate input: is array
if(Array.isArray(ary)){
//validate input: numberts only
if(!(testNumbersOnly(ary))){
console.log('Array input invalid, only numbers please.');
@dcorns
dcorns / PlayingCard.js
Created February 13, 2014 19:31
Simple Encapsulated Object and test
//Constructor
var Card=function(rank,suite){
function constructor(){};
constructor.prototype.getRank=function(){
return rank;
};
constructor.prototype.getSuite=function(){
return suite;
};
return new contructor();