Skip to content

Instantly share code, notes, and snippets.

View atomicpages's full-sized avatar
🏠
Working from home

Dennis Thompson atomicpages

🏠
Working from home
  • Rivian Automotive LLC
  • Palo Alto, CA
View GitHub Profile
@atomicpages
atomicpages / index.html
Last active December 10, 2015 03:28
A CodePen by atomicpages.
<div class="snowman">
<div class="head">
<div class="eyes">
<div class="eye left"></div>
<div class="eye right"></div>
</div>
<div class="nose">
<div class="inner"></div>
</div>
<div class="mouth">
<?php
/**
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info()
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems.
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento
* @author Magento Inc.
*/
@atomicpages
atomicpages / mage-menu-fade.js
Last active December 5, 2018 11:50
A simple script that allows the native Magento menu to fade in and out.
/**
* A simple jQuery-based magento fade script. It includes stopping
* on multiple hover events and forcing of the menu to show once
* the animation is complete. Additionally, we test to see if
* the browser supports the opacity property, if not then regular
* magento script will be used and no fade will be seen.
* @author Dennis Thompson <http://www.atomicpages.net/>
* @copyright AtomicPages LLC 2013
* @license MIT <http://opensource.org/licenses/MIT>
*/
@atomicpages
atomicpages / fbUrlCheck.php
Created January 24, 2013 09:37
A simple facebook URL checker RegEx for PHP or JavaScript
<?php
/**
* A simple regex to test whether or not a facebook url is valid. For basic usage, this will do the job.
* @see Test cases <http://ideone.com/ZMJp4f>
*/
$fbUrlCheck = '/^(https?:\/\/)?(www\.)?facebook.com\/[a-zA-Z0-9(\.\?)?]/';
$secondCheck = '/home((\/)?\.[a-zA-Z0-9])?/';
$validUrl = 'https://www.facebook.com/atomicpages/';
<p>Add an unlimited number of items to the navigation and the spacing will <em>always</em> fit the given viewport.</p>
<p class="warning">This is <strong>not</strong> compatible < IE 8</p>
<div class="wrapper">
<nav class="container">
<div class="nav inner">
<ul>
<li><a href="#">Foo</a></li>
<li><a href="#">Foo</a></li>
<li><a href="#">Foo</a></li>
<li><a href="#">Foo</a></li>
@atomicpages
atomicpages / class.log.php
Created October 15, 2014 20:31
A really simple logging class
<?php
/**
* Class Log
* A really simple logging class that writes flat data to a file.
* @author Dennis Thompson
* @license MIT
* @version 1.0
* @copyright AtomicPages LLC 2014
*/
<?php
/**
* Class Instagram
* A simple class that connects to the Instagram API without the overhead
* of other classes. This class depends on cURL being installed on your OS
* and it MUST be enabled in PHP. If you're not sure if it's enabled, you can
* run phpinfo() and search for cURL.
* @author Dennis Thompson
* @license MIT
<?php
/**
* Class CouldNotConnectDatabaseException
* @author Dennis Thompson
* @license MIT
* @version 1.0
*/
class CouldNotConnectDatabaseException extends Exception {
<?php
/**
* Class FileNotFoundException
* @author Dennis Thompson
* @license MIT
* @version 1.0
*/
class FileNotFoundException extends Exception {
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.File;
public class Prog3b {
public static void main(String[] args) {
System.out.println("Program 3, Dennis Thompson, masc001");
if(args.length != 2) {
System.err.println("Usage: java Prog3b infileName outfileName");