Skip to content

Instantly share code, notes, and snippets.

View dvigne's full-sized avatar

Derick Vigne dvigne

View GitHub Profile
@dvigne
dvigne / AppServiceProvider.php
Last active March 11, 2017 17:11
Check If Environment Is In Production Before Boostrapping The Rollbar Service Provider
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
@dvigne
dvigne / Handler.php
Created March 11, 2017 17:10
Log Errors To Rollbar and Laravel.log File
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Auth;
use Log;
class Handler extends ExceptionHandler
@dvigne
dvigne / tocsv.py
Created April 17, 2017 01:38
Convert All Whitespaces To CSV
import string
import sys
inputFile = open(sys.argv[1], 'r');
fileContents = inputFile.read();
fileContents = ','.join(fileContents.split());
print("Converted CSV: \n" + fileContents)
outputFile = open((inputFile.name).replace('.', '') + ".csv", 'w')
outputFile.write(fileContents)
@dvigne
dvigne / search.py
Last active April 18, 2017 22:46
Search Through CSV File For Criteria Given In A Text File
import string
import sys
inputFile = open(sys.argv[1], 'r')
searchCriteria = open(sys.argv[2], 'r')
csvContents = inputFile.read()
searchContents = searchCriteria.read()
csvArray = csvContents.split(',')
searchArray = searchContents.split()
@dvigne
dvigne / Deploy.md
Last active December 28, 2017 09:13

Quick note, be sure to change the sites name test to the name of your app

Update The Servers Definitions and Software

sudo apt update
sudo apt upgrade

Installing MySQL

sudo apt install mysql-server
@dvigne
dvigne / 16_bit_lfsr.c
Created March 2, 2018 02:45
A 16 LFSR with start state detection and pooling from the current system uptime
///////////////////////////////////////////////////////////////////////////////
//
// randomNum takes void arguments and gets its random seed from the current
// uptime of the system
//
///////////////////////////////////////////////////////////////////////////////
int randomNum(void) {
static uint16_t start_state = 0;
static uint16_t lfsr = 0;
if (lfsr == start_state) {
@dvigne
dvigne / Jenkinsfile
Created April 10, 2018 15:18
Jenkinsfile Boilerplate Template
pipeline {
agent any
environment {
GIT_NAME = sh returnStdout: true, script: "git --no-pager show -s --format='%an' ${env.GIT_COMMIT}"
}
stages {
stage(build) {
steps {
@dvigne
dvigne / cowsay.sh
Last active October 8, 2021 16:49
An Extremely Small Bash Script to Grad the Current Headline for Today in Computer History.
echo "Today in Computer History:\n" > ~/cowsay.txt;
http --body https://www.computerhistory.org/tdih/ | awk -F: '/chm-tdih-entry-title/ {gsub(/^[ \t]+/,"\n",$0); print; exit}' | sed -e 's/<[^>][^>]*>//g' -e '/^ -e *$/d' >> ~/cowsay.txt;
echo https://www.computerhistory.org/tdih/ >> ~/cowsay.txt;
@dvigne
dvigne / q.sh
Created April 17, 2019 15:52
Prom?
#!/bin/bash
echo " .----------------. .----------------. .----------------. .----------------. .----------------. ";
echo "| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |";
echo "| | ______ | || | _______ | || | ____ | || | ____ ____ | || | ______ | |";
echo "| | |_ __ \ | || | |_ __ \ | || | .' \`. | || ||_ \ / _|| || | / _ __ \`. | |";
echo "| | | |__) | | || | | |__) | | || | / .--. \ | || | | \/ | | || | |_/____) | | |";
echo "| | | ___/ | || | | __ / | || | | | | | | || | | |\ /| | | || | / ___.' | |";
echo "| | _| |_ | || | _| | \ \_ | || | \ \`--' / | || | _| |_\/_| |_ | || | |_| | |";
echo "| | |_____| | || | |____| |___| | || | \`.____.' | || ||_____||_____|| || | (_) | |";
@dvigne
dvigne / finger.sh
Last active April 23, 2019 15:07
finger.sh
#!/bin/bash
echo "";
echo "";
echo "....................../´¯/) ";
echo "....................,/¯../ ";
echo ".................../..../ ";
echo "............./´¯/'...'/¯¯·¸ ";
echo "........../'/.../..../......./¨¯\ ";