Skip to content

Instantly share code, notes, and snippets.

View dedunumax's full-sized avatar

Dedunu Dhananjaya dedunumax

View GitHub Profile
@dedunumax
dedunumax / DataHandler.java
Created February 7, 2014 16:41
This class shows how to save a list in a file. And how to load it back to memory.
package org.dedunumax.gist
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
public class DataHandler {
<gconfentryfile>
<entrylist base="/apps/gnome-terminal">
<entry>
<key>global/active_encodings</key>
<schema_key>/schemas/apps/gnome-terminal/global/active_encodings</schema_key>
<value>
<list type="string">
<value>
<string>UTF-8</string>
</value>
@dedunumax
dedunumax / ImageCutter.java
Created May 2, 2014 09:37
This program will cut a single image into several image files
package org.dedunumax.imagecutter;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class ImageCutter {
public static void main(String[] args) throws IOException {
@dedunumax
dedunumax / Dedunu.bf
Last active August 29, 2015 14:01
Just print Dedunu.
+++++ +++++
[
> +++++ ++
> +++++ +++++
> +++++ +++++ +
<<< -
]
> -- .
> + .
- .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Check file size</title>
</head>
<body>
<div>
@dedunumax
dedunumax / service-context.xml
Created March 4, 2015 11:51
service-context.xml for FileSizeWebScript
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
<webscript>
<shortname>File Size</shortname>
<description>Returns the file size of the given nodeRef</description>
<url>/size?nodeRef={RefForNode}</url>
<authentication>user</authentication>
<format default="html">extension</format>
<family>File Size Utilities</family>
</webscript>
@dedunumax
dedunumax / kdtree-sample.js
Created March 4, 2015 10:37
KDTree example from NodeJS
/*
* You can download geo.txt from - https://github.com/Adslot/node-puzzle/blob/master/01-geo-lookup/data/geo.txt
*/
var fs = require('fs');
var kd = require('kdtree');
var kdtree = new kd.KDTree(3);
//var kdtree = new kd.KDTree(4);
@dedunumax
dedunumax / .gitignore Alfresco
Last active August 29, 2015 14:16
Complete .gitignore for Alfresco Maven Projects
##########################
## Alfresco
##########################
**/alf_data_dev
**/solr_home
**/solr.log*
**/share.log*
**/alfresco.log*
##########################
<webscript>
<shortname>Java based Sample Webscript</shortname>
<description>This simple WebScript prints Hello World</description>
<url>/dedunu/helloworld</url>
<authentication>user</authentication>
<format default="html"></format>
</webscript>