Skip to content

Instantly share code, notes, and snippets.

View Michaela-Davis's full-sized avatar

Michaela D. Davis Michaela-Davis

View GitHub Profile
@Michaela-Davis
Michaela-Davis / PE_release_downloads.json
Last active April 9, 2021 17:47
Structure for JSON to generate PE release downloads
{
"release": "2019.8.5",
"PuppetEnterpriseAgents": [
{
"name": "EL (RHEL, CentOS, Scientific Linux, Oracle Linux) 8 (x86_64)",
"type": "el",
"url": "https://pm.puppetlabs.com/puppet-agent/2019.8.5/6.21.1/repos/el/8/puppet6/x86_64/puppet-agent-6.21.1-1.el8.x86_64.rpm"
},
{
@Michaela-Davis
Michaela-Davis / runMe.js
Created June 11, 2019 23:41
CSV to HTML
#!/usr/bin/env node
const csv = require("csvtojson");
const fs = require('fs');
csv()
.fromFile(`${__dirname}/dependencies.csv`)
.then((json)=>{
// console.log(json);
const html = json.map(row => {
let repository = row.repository;
// define simple debounce https://davidwalsh.name/javascript-debounce-function
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
@Michaela-Davis
Michaela-Davis / throttle.js
Created March 16, 2018 00:05
throttle function
function throttle(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
if (!options) options = {};
var later = function() {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
@Michaela-Davis
Michaela-Davis / _header.scss
Created October 10, 2017 21:23
header nav w/ centered logo (clave)
#header.full-header {
$c-header: #fff;
$c-menu-trigger: #444;
$nav-font: $ff-bree;
width: 100%;
height: 100px;
&--transparent {
position: absolute;
@Michaela-Davis
Michaela-Davis / _team-carousel.scsss
Created October 7, 2017 21:49
arrows on carousels
➜ nicerink-website git:(develop) ✗ git status
On branch develop
Your branch is behind 'origin/develop' by 2 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
@Michaela-Davis
Michaela-Davis / getProfilePicture.service.js
Created July 7, 2017 16:34
Dashboard bits - dashboard/app/services/getProfilePicture.service.js, dashboard/app/jobs/index.js
'use strict';
//controller import stuff
const pkg = require.main.require('../package.json');
const mongoose = require('mongoose');
const superagent = require('superagent');
const Promise = require('bluebird');
const _ = require('lodash');
module.exports = getProfilePictures;
'use strict';
const https = require('https');
const superagent = require('superagent');
module.exports = {
index
}
function index(req, res, next) {
@Michaela-Davis
Michaela-Davis / WeatherController.php
Created May 11, 2017 21:43
PHP / Drupal return api results in json format - line 9 - see drupal_cassette-store
class WeatherController
{
public function api() {
$city = 'Missoula';
$state = 'MT';
$weather = 'http://api.wunderground.com/api/28eb4ab328f37f10/conditions/q/' . $state . '/' . $city . '.json';
// $apiKey = '28eb4ab328f37f10';
$result = file_get_contents($weather);
$weather_array = json_decode($result, true);