Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / docker_wordpress.md
Last active June 11, 2025 06:27
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@aaronksaunders
aaronksaunders / snippet.js
Last active July 31, 2018 08:14
Cordova camera - Choose camera OR photo library
//
// you need the actionsheet plugin, image picker plugin and the camera plugin for this code to work
//
/**
* displays an action sheet for the user to select a photo from
* the gallery or using the camera
*
* @param _event {Object} information from the webview on the event
*
@pibby
pibby / JS: Highlight current menu item on fixed nav as user scrolls
Last active May 29, 2018 15:05
JS: Highlight current menu item on fixed nav as user scrolls
// Highlight current page menu item as user scrolls
var lastId,
pageMenu = $(".nav"),
pageMenuHeight = pageMenu.outerHeight() + 126,
// All list items
menuItems = pageMenu.find("a"),
// Anchors corresponding to menu items
scrollItems = menuItems.map(function(){
var item = $($(this).attr("href"));
if (item.length) { return item; }
@joshlong
joshlong / MvcRestApplicationInitializer.java
Last active October 11, 2023 20:07
This is a complete working Spring MVC REST application. The only thing unspecified are the imports and the Maven pom.xml. Deploy this class as a .war using Spring MVC 3.2.x (and, specifically, the spring-webmvc library) and you're done!
/**
* <p>This will be picked up in a Servlet 3 environment like Apache Tomcat 7.
*
* <p>This replaces <code>web.xml</code>.
*
*/
public class MvcRestApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override protected Class<?> [] getRootConfigClasses() {