Skip to content

Instantly share code, notes, and snippets.

View wingyplus's full-sized avatar
😶‍🌫️
Burned out

Thanabodee Charoenpiriyakij wingyplus

😶‍🌫️
Burned out
View GitHub Profile
@mastef
mastef / isexist_vs_isnotexist.go
Created February 4, 2016 08:30
os.IsExist(err) vs os.IsNotExist(err)
/*
Watch out, os.IsExist(err) != !os.IsNotExist(err)
They are error checkers, so use them only when err != nil, and you want to handle
specific errors in a different way!
Their main purpose is to wrap around OS error messages for you, so you don't have to test
for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and
"file does not exist/directory does not exist"
@wingyplus
wingyplus / gist:6446274
Last active December 22, 2015 08:38
install lib dependencies alfresco
apt-get install libsm6 libice6 libxrender1 libxext6 fontconfig
-module(chat).
-export([server/1, client/0]).
server(Clients) ->
receive
{client, Client} ->
server(Clients ++ [Client]);
{msg, Message} ->
send_message(Message, Clients),
importClass(Packages.org.springframework.web.context.ContextLoader);
importClass(Packages.org.alfresco.service.cmr.repository.TransformationOptions);
var context = ContextLoader.getCurrentWebApplicationContext();
var alfThumbnailService = context.getBean("thumbnailService");
alfThumbnailService.updateThumbnail(document.getThumbnail("webpreview").nodeRef, new TransformationOptions());