Skip to content

Instantly share code, notes, and snippets.

@geosava
geosava / tjug.jsh
Created May 31, 2018 07:26 — forked from mcupak/tjug.jsh
Exploring Java 9 APIs with JShell at TJUG - session notes.
HashSet<String> set = new HashSet<String>()
set.add("a")
set.add("b")
set.add("c")
Collections.unmodifiableSet(set)
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
@geosava
geosava / introrx.md
Created May 25, 2018 10:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@geosava
geosava / slack_history.py
Created October 27, 2017 11:37 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
# MIT License
# Copyright (c) 2016 Chandler Abraham
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@geosava
geosava / oreilly.py
Created August 7, 2017 09:36 — forked from nhumrich/oreilly.py
get free o'reilly books
"""Script to download free O'Reilly ebooks."""
import asyncio
import os
import re
import sys
import aiohttp
filename_matcher = re.compile(r'http://www.oreilly.com/(.*)/free/(.*).csp')
session = None
@geosava
geosava / nodered.conf
Created November 30, 2016 14:38 — forked from natcl/nodered.conf
Node-red startup file for Synology (/etc/init)
# only start this service after the httpd user process has started
#start on syno.network.ready
start on runlevel 2
# stop the service gracefully if the runlevel changes to 'reboot'
stop on runlevel [06]
# run the scripts as the 'admin' user. Running as root (the default) is a bad idea.
setuid admin
@geosava
geosava / README.md
Created November 16, 2016 13:56 — forked from mblackstock/README.md
FRED Node-RED hosted chat application with sentiment analysis

This flow uses http nodes and web sockets nodes to serve up a simple web page with a chat application that colours messages depending on whether they are positive or negative according to the sentiment node.

Copy the flow, and import it from the clipboard using Node-RED on FRED.

Change the URL ws://fred.sensetecnic.com/public/guides/receive and ws://fred.sensetecnic.com/public/guides/publish, replacing guides with your FRED user name.

Change the same URL to get it working on a 'stock' Node-RED install, or check it out on the Node-RED flows library - flows.nodered.org.

@geosava
geosava / maven-archetype.list
Created May 17, 2016 09:45 — forked from zbigniewTomczak/maven-archetype.list
Maven archetypes list (mvn archetype:generate)
Choose archetype:
1: remote -> br.gov.frameworkdemoiselle.archetypes:demoiselle-jsf-jpa (Archetype for web applications (JSF + JPA) using Demoiselle Framework)
2: remote -> br.gov.frameworkdemoiselle.archetypes:demoiselle-minimal (Basic archetype for generic applications using Demoiselle Framework)
3: remote -> co.ntier:spring-mvc-archetype (An extremely simple Spring MVC archetype, configured with NO XML.)
4: remote -> com.agilejava.docbkx:docbkx-quickstart-archetype (-)
5: remote -> com.alibaba.citrus.sample:archetype-webx-quickstart (-)
6: remote -> com.bsb.common.vaadin:com.bsb.common.vaadin.embed-simple-archetype (-)
7: remote -> com.bsb.common.vaadin:com.bsb.common.vaadin7.embed-simple-archetype (-)
8: remote -> com.cedarsoft.open.archetype:multi (-)
9: remote -> com.cedarsoft.open.archetype:simple (-)
@geosava
geosava / unproxy.java
Created October 19, 2015 12:46 — forked from maikelsperandio/unproxy.java
Method to unproxy an object from hibernate proxy
@SuppressWarnings("unchecked")
protected T unproxy(T entity){
if (entity == null) {
return null;
}
if (entity instanceof HibernateProxy) {
try {
Hibernate.initialize(entity);
} catch (ObjectNotFoundException e) {
@geosava
geosava / copy.swift
Created October 12, 2015 21:22 — forked from zhangxigithub/copy.swift
swift copy
import Cocoa
class Human:NSCopying
{
var name = ".."
var spouse:Human?
func copy() -> AnyObject! {