Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean O'Neil SeanPONeil

View GitHub Profile
@SeanPONeil
SeanPONeil / JP.java
Created Oct 23, 2011
Method to detect duplicates in array of integers in Java
View JP.java
boolean detectDuplicates( int [] x){
Set <Integer> intSet = new HashSet<Integer>();
for( int i: x){
if(intSet.contains(i)){
return true;
}
intSet.add(i);
}
return false;
}
@SeanPONeil
SeanPONeil / nodeBody.txt
Created Jan 11, 2012
Sample Node body HTML
View nodeBody.txt
<p>
<object height="315" width="560"><param name="movie" value="http://www.youtube.com/v/L3qnJdSVmSc?version=3&amp;hl=en_US" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed allowfullscreen="true" allowscriptaccess="always" height="315" src="http://www.youtube.com/v/L3qnJdSVmSc?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="560"></embed></object></p>
<p>
As <a href="http://mgoblog.com/mgoboard/ace-michigan-offers-13-ol-logan-tuley-tillman" style="text-align: -webkit-auto; " target="_blank">reported here</a> earlier today, Michigan offered 2013 Peoria (IL) Manual OL Logan Tuley-Tillman today. He now holds offers from Michigan, Mizzou, Illinois, and Indiana, and the <a href="http://mgoblog.com/diaries/introducing-logan-tuley-tillman" style="text-align: -webkit-auto; " target="_blank">last time I talked to him</a> he said that a Michigan offer would put the Wolverines at the top of his list. What did he have to say today? We talked over
@SeanPONeil
SeanPONeil / node.html
Created Jan 20, 2012
Sample Node body
View node.html
<p style="line-height: normal" class="content"><span>NOTRE DAME IS BRIAN BOITANO TIME</span></p> <p style="line-height: normal" class="content"><span><object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/ZwgiGRmdFZ0?version=3&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ZwgiGRmdFZ0?version=3&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object></span></p> <h3><span>The Essentials&#160; <a href="http://mgoblog.com/sites/mgoblog.com/files/images/Puck-Preview-Notre-Dame_925/5576114507_117f9ef3d41.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="5576114507_117f9ef3d4[1]" border="0" alt="5576114507
@SeanPONeil
SeanPONeil / MGoBlog.css
Created Jan 20, 2012
CSS for MGoBlog on Android
View MGoBlog.css
img {
max-width: 100%
}
blockquote {
background-color:#F8FFA4;
border-bottom-color:black;
border-bottom-style:solid;
border-bottom-width:1px;
border-image:initial;
@SeanPONeil
SeanPONeil / innodb.php
Created Feb 3, 2012
PHP Script for converting all tables in database to InnoDB engine
View innodb.php
<?php
$link = db_connect();
$query = "SHOW tables";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
$tbl = $row[0];
@SeanPONeil
SeanPONeil / SimpleCursorLoader.java
Created Feb 23, 2012 — forked from casidiablo/SimpleCursorLoader.java
Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview
View SimpleCursorLoader.java
import android.content.Context;
import android.database.Cursor;
import android.support.v4.content.AsyncTaskLoader;
/**
* Used to write apps that run on platforms prior to Android 3.0. When running
* on Android 3.0 or above, this implementation is still used; it does not try
* to switch to the framework's implementation. See the framework SDK
* documentation for a class overview.
*
View PullToRefreshListFragment.java
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
public class PullToRefreshListFragment extends ListFragment {
@SeanPONeil
SeanPONeil / BlockingIntentService.java
Last active Sep 27, 2017
An extension of the IntentService class that will block an Intent from entering the queue if the same Intent is already in the queue.
View BlockingIntentService.java
package com.atami.mgodroid.util;
import java.util.LinkedList;
import android.app.IntentService;
import android.content.Intent;
/**
* An extension of the IntentService class that will block
View NodeIndexProvider.java
public class NodeIndexProvider extends ClassContentProvider {
public static final Uri CONTENT_URI = Uri.parse("content://com.atami.mgodroid.provider/node_indices");
public NodeIndexProvider() {
provideClass(NodeIndex.class);
}
}
View NodeIndex.java
@Table(name = "node_indices")
@MimeType(company = "com.atami")
@Authority(name = "com.atami.mgodroid.provider")
public class NodeIndex {
@Column(name = "name")
String name;
@Column(name = "_id")
@PrimaryKey
You can’t perform that action at this time.