Skip to content

Instantly share code, notes, and snippets.

@nateperry
nateperry / detailer.jsp
Last active August 31, 2015 19:22
Simple JSP Object Detailer
<%--
Prints out all properties of a particular object
Slightly Revised version from original: http://stackoverflow.com/a/24576688
--%>
<c:set var="object" value="${SOMEOBJECT}" />
<c:if test="${!empty object.class.declaredFields}">
<h2>Object Attributes <em>&dollar;{object.name}</em></h2>
<ul>
<c:forEach var="attr" items="${object.class.declaredFields}">
@nateperry
nateperry / simple-scroll.js
Last active August 29, 2015 14:24
Simple jQuery Scroller
/*
* Simple jQuery Scroller
* Uses jQuery to animate scrolling on click
* Simply use the ID that you want to scroll to
* as the href attribute of an <a> tag
*
* Example HTML: <a href="#main" class="scroll-to">Scroll to #main</a>
*
*/
$(document).ready(function () {
@nateperry
nateperry / Sass Icon List
Created April 26, 2015 06:30
For a project with a lot of custom icons, I needed an easy to maintain solution for adding new icon classes. The parents part comds in to allow parent elements to be hovered and still show the hover icon.
// to add new icons, add the file to the media/icons folder
// then add the name of the file to the $icon-list
// each item will get a class name that matches the file name
$icon-list: add_widget alert appointments back blood_glucose blood_pressure chat collapse expand find_doctor fitness_planner food_journal github internet linkedin medical_history medication message nav_back nav_next overview patient_directory personal_profile recipe regimen_plan search settings sleep_analysis widget_directory
// all parent elements that need to trigger icon hover
$parents: '.btn' '.widget-button'
=all-icons
@each $icon in $icon-list
@nateperry
nateperry / CanvasStarter.js
Created October 30, 2014 22:16
This is a simple starter for working with canvas.
/*
Created by Nate Perry
http://github.com/nateperry
*/
var App;
App = {
canvas: null,
ctx: null,
@nateperry
nateperry / MY_DB_mysql_driver.php
Last active April 19, 2016 08:40 — forked from stevenwoodson/MY_DB_mysql_driver.php
A Codigniter mysql driver that adds the ability to have "INSERT ... ON DUPLICATE UPDATE" statements. This is a forked version which has been changed to appear more inline with the built in Codeigniter functions.
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_DB_mysql_driver extends CI_DB_mysql_driver {
final public function __construct($params) {
parent::__construct($params);
}
/**
* Insert_On_Duplicate_Update