Skip to content

Instantly share code, notes, and snippets.

View BrandKNY's full-sized avatar

Brandon Kearns BrandKNY

View GitHub Profile
import java.util.Random;
import java.util.Scanner;
public class GuessingGame {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
Random generator = new Random();
final int MAX = 10;
int answer, guess;
String another = "y";
const spawn = require('child_process').spawn;
const read = require('read');
const inpathSync = require('inpath').sync;
const pidof = require('pidof');
const path = process.env['PATH'].split(':');
const sudoBin = inpathSync('sudo', path);
let cachedPassword = null;
@BrandKNY
BrandKNY / IfElse.java
Created November 29, 2016 01:19
Flow Control with If-Else clauses
public class IfElse {
public static void main (String[] args) {
int a = 4;
if (a == 1) {
System.out.println("A is 1");
} else {
if (a == 2) {
@BrandKNY
BrandKNY / init.sls
Created June 10, 2015 20:44
SaltStack Reactor-Orchestration-State example workflow using Require statements
# Location: /srv/salt/raidarray/
## notice namespacing at top-level of each block, followed by the module.function
raid-create-array:
cmd.script:
- source: salt://raidarray/create_raid.sh
- cwd: /
- user: root
# here I am calling the pkg module and installed function but it requires first that cmd module ran previously on namespaced