View this code at http://livecoding.io/3777704
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
var storeImageLocally = function(imageFile, callback){ | |
// result of asynchronous call which will store the file | |
var result = { | |
localUrl: 'filesystem:http://localhost:9000/persistent/someImage.jpg', | |
imageId: 'generated uid' | |
} | |
// call the callback with html to insert into redactor | |
callback('<img src="'+result.localUrl+'" data-image-id="'result.imageId'">'); | |
} |
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
// http://www.highcharts.com/docs/export-module/render-charts-serverside | |
'use strict'; | |
var PdfPrinter = require('pdfmake'), | |
printer, | |
moment = require('moment-timezone'), | |
path = require('path'), | |
fs = require('fs'); | |
function resolvePath(relative) { |
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
On Feb 20, 2009, at 4:24 PM, "Olusegun A.A" <xxxxxx@gmail.com> wrote: | |
** CRAIGSLIST ADVISORY --- AVOID SCAMS BY DEALING LOCALLY | |
** Avoid: wiring money, cross-border deals, work-at-home | |
** Beware: cashier checks, money orders, escrow, shipping | |
** More Info: http://www.craigslist.org/about/scams.html | |
Hello, | |
Do you still have this item available for sale at the moment? Get back asap. |
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 ruby | |
=begin | |
This script backups and updates all dokuwiki installations on this server | |
Copyright (c) 2010 by Johannes Thönes <johannes.thoenes@googlemail.com> | |
Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php | |
=end | |
# Library Requirements | |
require 'net/http' # for download of the files | |
require 'open-uri' # for download of the files |
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
svn log | ruby -e "puts STDIN.read.split(/\n/).select{|l| l =~ /^r\d+/}.map{|l| l.split('|')[1].strip}.uniq.sort" |
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
def insertionSort(unsortedList : List[String]) = { | |
val F = unsortedList.toArray | |
for(i <- (2 until F.length)){ | |
val m = F(i) | |
var j = i; | |
while(j > 1 && !sorted){ | |
if (F(j-1) >= m) { | |
F(j) = F(j-1) | |
j -= 1 | |
} |
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 static <l> L[] createHeapPollution(L... args) { | |
Object[] elements = args; | |
elements[0] = Arrays.asList(12, 12); | |
return args; | |
} | |
public static void main(String... args) { | |
List<string>[] polluted = createHeapPollution(Arrays.asList("a", "b", "c")); | |
// java.lang.Integer cannot be cast to java.lang.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
finally { | |
try { | |
if (resultSet != null) { | |
resultSet.close(); | |
} | |
} catch (SQLException ex) { | |
logger.error("Error in Database", ex); | |
} finally { | |
try { |
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
package net.jthoenes.blog.spike.lambda; | |
import java.util.Arrays; | |
import java.util.List; | |
public class LambdaIntro { | |
public static interface ItemWithIndexVisitor<E> { | |
public void visit(E item, int index); |
OlderNewer