Skip to content

Instantly share code, notes, and snippets.

@ledlogic
ledlogic / boostrap-youtube-modal.js
Last active December 29, 2015 03:29 — forked from jawinn/boostrap-youtube-modal.js
* Modifies youtube anchor urls * Uses purl plugin instead of queryparser plugin. * Uses require * Self-contained html
/**
* Modifies youtube anchor urls
* Uses purl plugin instead of queryparser plugin.
* Uses require
* If too small, punts and goes to original url (use target to pop).
*
* @see http://www.joshuawinn.com/opening-youtube-links-dynamically-in-a-twitter-bootstrap-modal-window/
*/
define(['require',
@ledlogic
ledlogic / gist:8532028
Last active January 3, 2016 22:59
System.currentTimeMillis versus (new Date()).getTime()
package ledlogic.com.utility;
import java.util.Date;
import org.apache.log4j.Logger;
import org.junit.Test;
public class MsTest {
private static final Logger LOG = Logger.getLogger(MsTest.class);
@ledlogic
ledlogic / Gps3.ino
Created July 31, 2014 13:11
GPS code for current position
/*
This program demonstrates the dGPS library from Dexter Industries for Arduino
For use with the Dexter Industries GPS Shield. The dGPS can be found here:
- http://dexterindustries.com/Arduino-GPS_Shield.html
This code was originally based on the work of others. You can see the original work here:
- SoftwareSerial Library: http://www.arduino.cc/en/Reference/SoftwareSerial
- GPS Tutorial: http://www.arduino.cc/playground/Tutorials/GPS
@ledlogic
ledlogic / FromStringBuilder.java
Created August 1, 2014 02:29
Simple from string builder (reverse of a ToStringBuilder).
public class FromStringBuilder {
/**
* Parses a string formatted with toStringBuilder
*
* @param input - ex. "Path[id=1039916,displayName=School Home,description=<null>,...]"
* @return hashmap of name value pairs - ex. id=1039916,...
*/
public static Map<String, String> stringToMap(String input) {
LinkedHashMap<String, String> ret = new LinkedHashMap<String, String>();
@ledlogic
ledlogic / GpsLogger.ino
Last active December 7, 2015 19:42
A logger for GPS
#include "SoftwareSerial.h"
#include "dGPS.h"
#include "SPI.h"
#include "SD.h"
#include "stdlib.h"
// SD card
const int CS_pin = 10;
dGPS dgps = dGPS(); // Construct dGPS class
@ledlogic
ledlogic / StackOverflowSpec.groovy
Created August 6, 2014 03:47
Test case example attempting to catch a dropped f5 connection via a Spock functional test.
package com.***.catalog.url
import org.apache.http.client.HttpClient;
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
import groovyx.net.http.*
import org.apache.http.Header
import org.apache.http.HttpResponse;
@ledlogic
ledlogic / LCDTempOneWire.ino
Created August 23, 2014 02:39
LCD display of temp with lcd + onewire + dallas libraries
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
// Data wire is plugged into pin 1 on the Arduino
#define ONE_WIRE_BUS 1
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
@ledlogic
ledlogic / LCD_Buttons.ino
Created August 23, 2014 02:56
Worked right out of the box, excellent program from Mark Bramwell.
/*************************************************************************************
Mark Bramwell, July 2010
This program will test the LCD panel and the buttons.When you push the button on the shield,
the screen will show the corresponding one.
Connection: Plug the LCD Keypad to the UNO(or other controllers)
**************************************************************************************/
@ledlogic
ledlogic / AlphabetGame.ino
Created October 28, 2014 16:15
A setup for the Alphabet Game - three buttons are required, and players attempt to be the first to find the next letter.
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // select the pins used on the LCD panel
int bluePin = 11;
int greenPin = 12;
int redPin = 13;
void setup()
{
@ledlogic
ledlogic / LCDDiceRoller.iso
Last active August 29, 2015 14:14
LCDDiceRoller.iso
/*************************************************************************************
Dieroller
Uses the library TrueRandom from https://code.google.com/p/tinkerit/wiki/TrueRandom
(c) 2015 Jeff D. Conrad
**************************************************************************************/
#include <LiquidCrystal.h>