Skip to content

Instantly share code, notes, and snippets.

View danseethaler's full-sized avatar

Dan Seethaler danseethaler

View GitHub Profile
@danseethaler
danseethaler / cloudSettings
Created October 10, 2019 01:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-10T01:55:48.925Z","extensionVersion":"v3.4.3"}
@danseethaler
danseethaler / Checkbox.js
Last active January 22, 2018 17:19
Form component example
import React from 'react'
import { FormControl, FormControlLabel } from 'material-ui/Form'
import { withStyles } from 'material-ui/styles'
import Checkbox from 'material-ui/Checkbox'
import styles from '../../config/styles'
const SwitchInput = ({
classes,
type,

All repository sets: GET "/repository_sets/?organization_id=ID"

{
  "total": 5,
  "subtotal": 5,
  "page": null,
  "per_page": null,
  "error": null,
@danseethaler
danseethaler / reducers.js
Last active November 21, 2017 14:32
Using the reducer registration from theforeman
import { combineReducers } from 'redux';
import redHatRepositories from './RedHatRepositories';
import { registerReducer } from 'foremanReact/common/MountingService';
const rootReducer = combineReducers({
redHatRepositories,
});
registerReducer('katello_reducers', rootReducer);
import React from 'react';
import { connect } from 'react-redux';
import onClickOutside from 'react-onclickoutside';
import * as NotificationActions from '../../redux/actions/notifications';
import './notifications.scss';
import ToggleIcon from './toggleIcon/';
import Drawer from './drawer/';
import { groupBy, isUndefined } from 'lodash';
class notificationContainer extends React.Component {
@danseethaler
danseethaler / install.out
Created October 16, 2017 14:47
theforeman/foreman npm install output
npm WARN deprecated jquery-flot@0.8.3: flot has been abandoned
npm WARN deprecated babel-preset-es2015@6.6.0: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN prefer global colorguard@1.2.0 should be installed with -g
npm WARN prefer global node-gyp@3.6.2 should be installed with -g
> node-zopfli@2.0.2 install /home/vagrant/foreman/node_modules/node-zopfli
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@6.11.3 (node-v48 ABI) (falling back to source compile with node-gyp)
<div class="btn-group" uib-dropdown is-open="status.isOpen" keyboard-nav>
<button type="button" class="btn btn-default" ng-click="toggleDropdown($event)">
<span translate>Select Action</span>
</button>
<button type="button" class="btn btn-default" ng-click="toggleDropdown($event)">
<span class="caret"></span>
<span class="sr-only" translate>Toggle Dropdown</span>
</button>
</div>
@danseethaler
danseethaler / js_object_version.js
Created July 7, 2017 04:55
JS Objects to MySQL
const subscribers = {};
module.exports = subscriptions = {
subscribe: function(clientId, dataId) {
// Add subscribed user/data to the subscriptions object
const user = subscribers[clientId] || {};
user[dataId] = true;
subscribers[clientId] = user;
@danseethaler
danseethaler / example_reducer.js
Last active July 7, 2017 04:31
Simplify Redux Reducer
const initialState = [];
// Using initialState as a default parameter uses the initial state on first render
export default function (state = initialState, action) {
switch (action.type) {
case 'SET_ATTRACTIONS':
return action.attractions;
@danseethaler
danseethaler / new.js
Created July 7, 2017 04:01
AWS Revert File Version Rework
import { promisify } from 'util';
const readFilePromise = promisify(fs.readFile);
AwsFinder.prototype.revertFileVersion = async function(data, cb) {
log('aws', ['Reverting version:', data.id]);
// Get the current file buffer for diff comparison
try {
let originalBuffer = await readFilePromise(data.remote);
} catch (e) {