Skip to content

Instantly share code, notes, and snippets.

@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.
View DataHandler.java
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 {
View terminal-color-scheme.xml
<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
View ImageCutter.java
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.
View Dedunu.bf
+++++ +++++
[
> +++++ ++
> +++++ +++++
> +++++ +++++ +
<<< -
]
> -- .
> + .
- .
@dedunumax
dedunumax / service-context.xml
Created March 4, 2015 11:51
service-context.xml for FileSizeWebScript
View service-context.xml
<?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
View size.get.desc.xml
<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>
View size.get.html
<!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 / FileSizeWebScript.java
Last active August 29, 2015 14:16
Calculates folder size from given nodeRefId.
View FileSizeWebScript.java
package org.dedunu.alfresco;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef;
@dedunumax
dedunumax / kdtree-sample.js
Created March 4, 2015 10:37
KDTree example from NodeJS
View kdtree-sample.js
/*
* 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
View .gitignore Alfresco
##########################
## Alfresco
##########################
**/alf_data_dev
**/solr_home
**/solr.log*
**/share.log*
**/alfresco.log*
##########################