Skip to content

Instantly share code, notes, and snippets.

View Deanout's full-sized avatar
💭
Should be sleeping.

Dean DeHart Deanout

💭
Should be sleeping.
View GitHub Profile
public partial class Form1 : Form {
public static Random r = new Random();
private int score = 0;
private int die1;
private int die2;
private int dieTotal;
private int point;
public Form1() {
@Deanout
Deanout / dehart.lab2.ps1
Created February 8, 2018 20:31
Homework 2 sysadmin stuff
# Lab 2 - AD PowerShell Basics
# Name: Dean DeHart
# Date: 02/06/18
# Description: Reads users from a given CSV and adds them to the Domain Users in ADUC.
# Also contains function for changing password reset on logon and deleting users.
# Imports
Import-Module ActiveDirectory
# Variable Declarations
$users = import-csv Names.txt
#!/bin/bash
# Adds the given users to LDAP, provided via command line.
# Accepts multiple users.
users=()
passwds=()
for i in "$@"
do
parsed=(${i//:/ })
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
/**
*
* @author Dean
@Deanout
Deanout / Rails Setup.txt
Last active May 20, 2021 06:08
Ruby on Rails 6 Setup Ubuntu 18.04
Commands from http://howtoforge.com/tutorial/ubuntu-ruby-on-rails
Yarn from https://linuxize.com/post/how-to-install-yarn-on-ubuntu-18-04/
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable --ruby
Restart terminal
@Deanout
Deanout / index.html.erb
Created March 23, 2020 19:22
Using in_groups_of to create 3 posts per row layout.
<div class="container">
<div class="row">
<div class="digg_pagination">
<%= will_paginate @posts, :container => false %>
</div>
</div>
<!-- Creates a loop of @posts.count / 3 arrays -->
<% @posts.in_groups_of(3).each do |post_array| %>
<div class="row">
<!-- For each post in the array, give it a class of "col-4" which is 3 per row-->
@Deanout
Deanout / Production Deployment Commands Ubuntu 18.04
Created March 31, 2020 14:37
Deploy to production with nginx, passenger, capistrano, rails 6
These commands are meant to be followed in conjunction with:
https://www.youtube.com/watch?v=xpYpaRUFzTI
https://gorails.com/deploy/ubuntu/18.04
ssh [email protected]
adduser deploy
adduser deploy sudo
exit
ssh-copy-id [email protected]
ssh-copy-id [email protected]
@Deanout
Deanout / week8demo.rb
Created May 6, 2020 22:58
Demo for the week 8 20in20 project.
# frozen_string_literal: true
require 'fileutils'
require 'rails'
def add_gems
gem 'devise'
gem 'simple_form'
end
@Deanout
Deanout / TodoForm.js
Created May 17, 2020 06:49
Editing In The React Rails API - For Farooq
import React, { Component } from "react"
import TextField from '@material-ui/core/TextField'
import Button from '@material-ui/core/Button'
import Grid from "@material-ui/core/Grid"
import TextareaAutosize from "@material-ui/core/TextareaAutosize"
class TodoForm extends Component {
constructor(props) {
super(props)
// Overhauled this, defaults now come from todo list.
import React from "react";
import Grid from "@material-ui/core/Grid"
import Paper from "@material-ui/core/Paper"
import { makeStyles } from "@material-ui/core/styles"
import Button from "@material-ui/core/Button"
import DeleteIcon from "@material-ui/icons/Delete"
import UpdateIcon from "@material-ui/icons/Update"
import { Typography } from "@material-ui/core";
import TextField from '@material-ui/core/TextField';
import TextareaAutosize from '@material-ui/core/TextareaAutosize';