Skip to content

Instantly share code, notes, and snippets.

View tommyready's full-sized avatar
🎯
Focusing

Tommy Ready tommyready

🎯
Focusing
  • Charleston, SC
View GitHub Profile
@tommyready
tommyready / ImapService.php
Last active June 18, 2018 18:23
Laravel IMAP Service
<?php
namespace App\Services;
class ImapService {
protected $imapHost;
protected $imapEmail;
protected $imapPassword;
protected $searchCriteria;
@tommyready
tommyready / deployer5000.py
Last active January 10, 2018 01:47
Python Laravel Deployment Script
import git
import string
import os
from os import path
from git import *
from subprocess import call
class gitConnect():
def deploy(self):
@tommyready
tommyready / pydump.py
Created October 16, 2017 14:49 — forked from sagar-webonise/pydump.py
Python script for taking mysqldump
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def get_dump():
print "Enter user:"
user = raw_input()
@tommyready
tommyready / imageColor.js
Created August 5, 2017 01:09
Use pure JavaScript to get the color of a pixel on click
<script type="text/javascript" language="javascript">
var img = document.getElementById("myImage");
img.addEventListener("click", function(event) {
var canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
var p = canvas.getContext('2d').getImageData(event.offsetX, event.offsetY, 1, 1).data;
var hex = "#" + ("000000" + rgbToHex(p[0], p[1], p[2])).slice(-6);
@tommyready
tommyready / Hosts.py
Created July 19, 2017 17:46
Use Python to Automate Host File Edits
import os
import datetime
import re
import socket
import struct
import uuid
def normalize_ipv4(ip):
try:
@tommyready
tommyready / application.cfc
Last active April 13, 2017 17:15
Getting Application Scope Settings from INI File in CFSCRIPT
component {
this.name = 'MyApp' & hash(getCurrentTemplatePath());
this.applicationTimeout = createTimeSpan(1,0,0,0);
this.sessionTimeout = createTimeSpan(1,0,0,0);
this.sessionManagement = true;
this.setClientCookies = false;
public boolean function onApplicationStart() {
@tommyready
tommyready / test.cfm
Last active December 9, 2016 16:14
Coldfusion Test Range Script
<cfscript>
writeDump( getCurrentFboRates() );
LOCAL.aircraftTypeId = 1440;
LOCAL.startRange = 1;
LOCAL.endRange = 99;
@tommyready
tommyready / tLogger.dll
Last active November 14, 2016 15:38
Using C# to Create a Log Writer .DLL
using System;
using System.IO;
namespace tLogger
{
public class Log
{
private static Int32 maxFileSize = 10240000; // 10 MB
@tommyready
tommyready / combinePaths.cfm
Last active October 26, 2016 15:02
Coldfusion CFSCRIPT Function to Combine Array of Paths (Strings) into a Path (String)
<cfscript>
public string function combinePaths(required array paths) {
var fullPath = "";
for(var p=1; p <= ArrayLen(paths); p++) {
fullPath &= paths[p];
if(Right(paths[p],1) == "\") continue; // Continue to Next iteration if \ is already there
if(len((trim(GetFileFromPath(paths[p]) == 0)))) break; // Exit Loop on File Found // File should be last element in array
fullPath &= "\";
}
return fullPath;