Skip to content

Instantly share code, notes, and snippets.

View JoshuaCarroll's full-sized avatar
🏈
Scoreboards, scorebugs, SDK's, etc

Joshua Carroll JoshuaCarroll

🏈
Scoreboards, scorebugs, SDK's, etc
View GitHub Profile
@bertwagner
bertwagner / JSON date time in SQL .sql
Last active January 26, 2023 20:30
JSON date times converting to SQL data types
DECLARE @jsonData nvarchar(max) = N'{ "createDate" : "2017-03-28T12:45:00.000Z" }'
-- SQL's JSON_VALUE() will read in the JSON date time as a string
SELECT JSON_VALUE(@jsonData, '$.createDate')
-- Output: 2017-03-28T12:45:00Z
-- If we want to read it in as a SQL datetime2, we need to use a CONVERT() (or a CAST())
SELECT CONVERT(datetime2, JSON_VALUE(@jsonData, '$.createDate'))
-- Output: 2017-03-28 12:45:00.0000000
@phedoreanu
phedoreanu / apache ssh keys
Last active January 25, 2024 17:34
git PHP webhook
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R apache:apache /var/www/.ssh
sudo -u apache ssh-keygen (empty passphrase)
paste public key into repo manager
(git-repo) sudo -u apache git pull origin branch (this will create /var/www/.ssh/known_hosts)
call git_hook.php?branch=xxx
@JoshuaCarroll
JoshuaCarroll / AKO|Mail.mil email address
Created April 3, 2013 16:54
This regular expression will validate any mail.mil or AKO email address.
((.*?(\.).*?(@us\.army\.mil))|(.*?(\.).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil))|(.*?(\.)(([a-z])(\.)).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil)))
@JoshuaCarroll
JoshuaCarroll / Mail.Mil regex
Created April 3, 2013 16:51
This is a regular expression that will validate all email addresses in DISA's enterprise email system (aka "mail.mil").
((.*?(\.).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil))|(.*?(\.)(([a-z])(\.)).*?(\.)(civ|mil|ctr|nfg)(@mail\.mil)))
@demonixis
demonixis / toggleFullscreen.js
Created March 18, 2013 16:07
A simple function to toggle fullscreen in JavaScript. It work well on Firefox and Webkit browsers.
/**
* Toggle fullscreen function who work with webkit and firefox.
* @function toggleFullscreen
* @param {Object} event
*/
function toggleFullscreen(event) {
var element = document.body;
if (event instanceof HTMLElement) {
element = event;
@minkymorgan
minkymorgan / gist:4702013
Last active May 1, 2019 20:23
setup mysql on a raspberryPI
## shell commands I used to setup mysql on my raspberryPI and enable SQLyog access to it from my laptop
# install mysql using these instructions
# http://databaseblog.myname.nl/2013/01/how-to-install-mysql-succesfully-on.html
# Verify the MySQL Client was installed
mysql --version
# alter the settings to enable it to be a server on your lan
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->