Skip to content

Instantly share code, notes, and snippets.

View phillipuniverse's full-sized avatar

Phillip Verheyden phillipuniverse

View GitHub Profile
@phillipuniverse
phillipuniverse / gist:1004865
Created June 2, 2011 17:31
Andre Compass Example
@Override
public List<PBProductTire> findTiresForSize(String width, String ratio, String diameter, String passOrLightTruck, String ratingOrRange) {
String query = "alias:PBProductTire AND tireWidth:" + width + " AND tireRatio:" + ratio + " AND tireDiameter:" + diameter;
if (passOrLightTruck.equals("LT")) {
query += " AND tireType:LT";
} else {
query += " AND NOT tireType:LT";
}
CompassSearchSession session = compass.openSearchSession();
@phillipuniverse
phillipuniverse / ChangeRadius.h
Created June 6, 2011 20:11
CheckMark Table Cells
#import <Foundation/Foundation.h>
@protocol ChangeRadiusDelegate
-(void) updateRadius:(int)radius;
@end
@interface ChangeRadius : TTTableViewController {
int _radius;
id<ChangeRadiusDelegate> _delegate;
@phillipuniverse
phillipuniverse / haml_converter.rb
Created April 21, 2012 20:22 — forked from dtjm/haml_converter.rb
HAML plugin for jekyll
# _plugins/haml_converter.rb
module Jekyll
class HamlConverter < Converter
safe true
def setup
return if @setup
require 'haml'
@setup = true
@phillipuniverse
phillipuniverse / dependency-tree
Created May 10, 2012 03:27
BroadleafCommerceDemoSite master dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BroadleafCommerce Demo Site 1.6.0-GA
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ broadleaf-demo-site ---
[INFO] org.broadleafcommerce:broadleaf-demo-site:war:1.6.0-GA
[INFO] +- org.broadleafcommerce:broadleaf-framework-web:jar:1.6.0-GA:compile
[INFO] | +- org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
@Override
public FilterCriterionProvider getBetweenProvider(AssociationPath path) {
if (!path.equals(AssociationPath.ROOT)) {
return super.getBetweenProvider(path);
}
return new SimpleFilterCriterionProvider(FilterDataStrategy.NONE, 2) {
@Override
public DynamicResultSet inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper inspectHelper) throws ServiceException {
try {
PersistencePerspective persistencePerspective = persistencePackage.getPersistencePerspective();
Map<MergedPropertyType, Map<String, FieldMetadata>> allMergedProperties = new HashMap<MergedPropertyType, Map<String, FieldMetadata>>();
//Grab the default properties for the Sku
Map<String, FieldMetadata> properties = inspectHelper.getSimpleMergedProperties(PaymentResponseItem.class.getName(), persistencePerspective);
//Create the metadata for the collection
@Override
public DynamicResultSet inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper inspectHelper) throws ServiceException {
try {
PersistencePerspective persistencePerspective = persistencePackage.getPersistencePerspective();
Map<MergedPropertyType, Map<String, FieldMetadata>> allMergedProperties = new HashMap<MergedPropertyType, Map<String, FieldMetadata>>();
//Grab the default properties for the Sku
Map<String, FieldMetadata> properties = inspectHelper.getSimpleMergedProperties(PaymentResponseItem.class.getName(), persistencePerspective);
//Create the metadata for the collection
@Override
public DynamicResultSet inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper inspectHelper) throws ServiceException {
try {
PersistencePerspective persistencePerspective = persistencePackage.getPersistencePerspective();
Map<MergedPropertyType, Map<String, FieldMetadata>> allMergedProperties = new HashMap<MergedPropertyType, Map<String, FieldMetadata>>();
//Grab the default properties for the Sku
Map<String, FieldMetadata> properties = inspectHelper.getSimpleMergedProperties(PaymentResponseItem.class.getName(), persistencePerspective);
//Create the metadata for the collection
<b>this is some bold html</b>
<br />
<br />
<p>Now after a couple of line breaks, I have a new paragraph</p>
<p>This is more text in yet another paragraph</p>
<u></i>this is some cool underlined and italicized text</i></u>
@phillipuniverse
phillipuniverse / ntp.conf
Last active November 8, 2022 14:40
Set up NTP with Ansible, dedicating one as a timelord
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable