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 / csv-to-mysql.py
Created April 6, 2022 07:34 — forked from rasyadhs/csv-to-mysql.py
Python CSV to MySQL
View csv-to-mysql.py
#!/usr/bin/env python
# Run with no args for usage instructions
#
# Notes:
# - will probably insert duplicate records if you load the same file twice
# - assumes that the number of fields in the header row is the same
# as the number of columns in the rest of the file and in the database
# - assumes the column order is the same in the file and in the database
#
@tommyready
tommyready / WebsiteAndStoreCreator.php
Created April 24, 2021 03:44 — forked from 0-Sony/WebsiteAndStoreCreator.php
Magento 2 : Create Programmatically Website/Store/StoreGroup
View WebsiteAndStoreCreator.php
<?php
/**
* This file is part of Namespace for Magento.
*
* @license All rights reserved
* @author Phuong LE <phuong.le@agence-soon.fr> <@>
* @category Namespace
* @package Namespace_Core
* @copyright Copyright (c) 2016 Agence Soon (http://www.agence-soon.fr)
*/
@tommyready
tommyready / iis-create-sites.ps1
Created March 19, 2019 03:42
Windows Powershell Script to Create IIS Sites for Current User
View iis-create-sites.ps1
# IIS Site Creation Tool
# Verion: 0.0.1
# Author: Tommy Ready <tommy.r.ready@gmail.com>
# Description: Powershell Tool for auto creation of IIS sites per the user logged in.
# Run Command: C:\> .\iis-site-creator.ps1
$current_user = $env:UserName
$user_iis_folder = "C:\sites\$current_user"
$shared_directory = "C:\sites\shared"
$shared_media_direectory = $shared_directory + "\Data"
@tommyready
tommyready / ImapService.php
Last active June 18, 2018 18:23
Laravel IMAP Service
View ImapService.php
<?php
namespace App\Services;
class ImapService {
protected $imapHost;
protected $imapEmail;
protected $imapPassword;
protected $searchCriteria;
@tommyready
tommyready / dbcopier.py
Created October 16, 2017 17:49
Using Python to dump a Mysql database and import into another Mysql database
View dbcopier.py
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def combine_files(self,file1,file2):
with open('file1', 'w') as outfile:
with open(file2) as infile:
@tommyready
tommyready / pydump.py
Created October 16, 2017 14:49 — forked from sagar-webonise/pydump.py
Python script for taking mysqldump
View pydump.py
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def get_dump():
print "Enter user:"
user = raw_input()
@tommyready
tommyready / backerupper.py
Last active November 21, 2019 00:38
Using Python to Zip a Directory then Upload to AWS S3
View backerupper.py
import os, sys
import math
import boto
import string
import shutil
from os import path
from os import stat
from array import *
from time import gmtime, strftime
from boto.s3.key import Key
@tommyready
tommyready / deployer5000.py
Last active January 10, 2018 01:47
Python Laravel Deployment Script
View deployer5000.py
import git
import string
import os
from os import path
from git import *
from subprocess import call
class gitConnect():
def deploy(self):
@tommyready
tommyready / PDOService.php
Last active June 7, 2020 21:57
Laravel 5 Service that Wraps PDO to call StoredProcedure with Multiple ResultSets and Return Arrays of Data
View PDOService.php
<?php
namespace App\Services;
class PDOService {
private $connection;
public function __construct($connection) {
$this->connection = $connection;
@tommyready
tommyready / imageColor.js
Created August 5, 2017 01:09
Use pure JavaScript to get the color of a pixel on click
View imageColor.js
<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);