This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String toSingleByteISO8859(String unicode) { | |
if (unicode != null) { | |
try { | |
ByteBuffer encoded = ISO_8859_1.encode(unicode); | |
String convertedString = new String(encoded.array(), ISO_8859_1.displayName()); | |
return convertedString; | |
} catch (UnsupportedEncodingException e) { | |
logger.error("Problems converting to ISO-8859-1", e); | |
return "?"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media screen and (min-width: 1020px) { | |
#content:before { | |
content: " "; | |
background: url("/assets/images/layout/content-shadow@2x.png") 0 -542px no-repeat, url("/assets/images/layout/content-shadow@2x.png") right 0 no-repeat; | |
position: absolute; | |
top: 0; | |
left: -23px; | |
right: -23px; | |
display: block; | |
height: 540px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int insertManifestLine(final Integer shipmentNumber, final String countryCode, | |
final String organisationName, final String addressLine1, final String addressLine2, | |
final String town, final String county, final String postcode, final String title, | |
final String initials, final String name, final String telephoneNumber, final String email, | |
final String trackingNumber, final String orderNumber ) { | |
GeneratedKeyHolder key = new GeneratedKeyHolder(); | |
PreparedStatementCreator preparedStatementCreator = new PreparedStatementCreator() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "utf-8"; | |
/* Simple fluid media | |
Note: Fluid media requires that you remove the media's height and width attributes from the HTML | |
http://www.alistapart.com/articles/fluid-images/ | |
*/ | |
img, object, embed, video { | |
max-width: 100%; | |
} | |
/* IE 6 does not support max-width so default to width 100% */ | |
.ie6 img { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Timer { | |
def timer(t: => Any) = { | |
val start = System.currentTimeMillis | |
val func = t | |
val end = System.currentTimeMillis | |
println("function took " + (end - start) + " milliseconds") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.Actor | |
import akka.actor.Actor._ | |
import akka.camel.CamelServiceManager._ | |
import akka.camel.Consumer | |
object CronExample { | |
def main(args: Array[String]) { | |
val cronExpressions: List[String] = ... // cron expressions read from database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import base64, hashlib, hmac, json, sys, getpass | |
from Crypto.Cipher import AES | |
from Crypto.Hash import RIPEMD, SHA256 | |
base58_chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | |
def prompt(p): | |
return getpass.getpass(p + ": ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object SpringApp extends App { | |
val ctx = new AnnotationConfigApplicationContext | |
ctx.scan(/* FIXME: update to correct value */"base.namespace") | |
ctx.refresh() | |
val system = ctx.getBean(classOf[ActorSystem]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ReCaptchaVerifier { | |
def validate(reCaptchaRequest: ReCaptchaSecured): Boolean | |
} | |
@Service | |
class HttpClientReCaptchaVerifier @Autowired()( | |
httpClient: HttpClient, | |
servletRequest: HttpServletRequest, | |
@Value("${recaptcha_url}") recaptchaUrl: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import akka.actor.{ActorSystem, Actor, Props, PoisonPill} | |
import akka.routing.BroadcastRouter | |
object Clicker extends App { | |
val system = ActorSystem("clicker") | |
main |