Skip to content

Instantly share code, notes, and snippets.

View dima767's full-sized avatar
🎯
Focusing

Dmitriy Kopylenko dima767

🎯
Focusing
  • Unicon, inc.
  • Manalapan, NJ, USA
View GitHub Profile
def printHello() {
println 'Hello World'
}
sendMail {
to grailsProject.creator.email
subject "A new comment for project [${grailsProject.name}] has been posted"
body "${comment.member.displayName} said:\n\n${comment.body}\n\nSee the comment in context: ${createLink(controller: 'grailsProject', action: 'viewProject', id: params.id, absolute: true)}"
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>TEMPLATE : XHTML STRICT</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Your subject matter described." />
<meta name="keywords" content="your, key, words, here" />
<style type="text/css">
ul.action-menu,
ul.action-menu li {
package org.openregistry.integration;
/**
* An abstraction representing an integration subsystem for Open Identity Registry.
* The role of <code>IntegrationKernel</code> is to de-couple the core parts of OIR from 3rd party systems and abstract away the
* mechanism of actual integration and make it pluggable. For example different ESB-based implementations could be provided, configured and plugged into the core OIR system
* or web services-based one could be used, etc.
*
*<p><strong>Concurrent semantics:</strong> implementations of this interface must be thread-safe
*/
2009-05-19 10:41:24,237 ERROR [org.mule.config.builders.WebappMuleXmlConfigurationBuilder.configure()] - <Configuration with "org.mule.config.builders.WebappMuleXmlConfigurationBuilder" failed.>
org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Error creating bean with name 'customEditorConfigurer' defined in default-mule-config.xml: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.util.LinkedHashMap] to required type [java.util.Map] for property 'customEditors'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.mule.config.spring.editors.ConnectorPropertyEditor] to required type [java.lang.String] for property 'customEditors[org.mule.api.transport.Connector]': no matching editors or conversion strategy found
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpring
// Just playing with what 'git hash-object' impl. (for git blob types i.e. 'blob size\0contents') would look like in Groovy.
// Note: this is not a 'full-blown' implementation of sha1 functionality available in git
#!/usr/bin/env groovy
import java.security.MessageDigest
def sha1(byte[] buffer) {
if (!buffer) {
return null
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return 1 section which will be used to display the giant blank UITableViewCell as defined
// in the tableView:cellForRowAtIndexPath: method below
if ([self.searchResults count] == 0){
return 1;
} else if ([self.searchResults count] < self.webServiceDataModel.total) {
UIBarButtonItem * CreateAutoReleasedButtonWithTitle_Target_Action(NSString *title, id target, SEL actionSelector) {
return [[[UIBarButtonItem alloc] initWithTitle:title
style:UIBarButtonItemStyleBordered
target:target
action:actionSelector] autorelease];
}
UIBarButtonItem * CreateAutoReleasedButtonWithTitle(NSString *title) {
return CreateAutoReleasedButtonWithTitle_Target_Action(title, nil, nil);
}
@dima767
dima767 / gist:1407022
Created November 29, 2011 23:00
Higher order function for cas-server-clojure prototype
(defn cas-process-auth [cred handlers]
(if (empty? handlers)
{:authenticated false :handler :none}
(let [assertion ((first handlers) cred)]
(if (:authenticated assertion)
assertion
(recur cred (rest handlers))))))
import org.jasig.cas.services.RegisteredService;
import java.util.Map;
/**
* An extention to <code>RegisteredService</code> with extra arbitrary attributes
*
* @author Dmitriy Kopylenko
*/
public interface RegisteredServiceWithAttributes extends RegisteredService {