Skip to content

Instantly share code, notes, and snippets.

Going to Go

Chris Suszynski cardil

Going to Go
Block or report user

Report or block cardil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cardil /
Created Oct 15, 2015
Example of composition usage in Java 7 & 8 insead of JavaScript. Follow up to:
import lombok.Delegate;
interface Barker {
void bark();
class DefaultImpl implements Barker {
public void bark() {
System.out.println("Bark, Bark!");
cardil /
Last active Sep 5, 2018
Linux NVidia Optimus with external monitor - enable/disable scripts tested on Ubuntu. Source article:
# You will need latest NVIDIA drivers installed. At the time of writing, version is 331.20.
# On ubuntu 13.10, it looks like this:
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-331
# Now we need to install bumblebee:
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get install bumblebee bumblebee-nvidia bbswitch-dkms
cardil /
Last active Apr 7, 2019
MultiSelectListPreference for devices running Android in the API earlier than level 11. Support ChangeListener receiving list of selected values. Supports automatically setting of summary. Examples attached.
private static OnPreferenceChangeListener autoOnChangeListener = new OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference rawPreference, Object newValue) {
List<CharSequence> selected = Arrays.asList((CharSequence[]) newValue);
if (selected.contains("1")) {
// do some work
return true;
cardil /
Last active Dec 12, 2015
Vaadin slider with text box for input value, with events and implementing Field so suitable for forms. See:
* Copyright (c) 2013 Wave Software.
* The source code contained in this file is owned and/or is subject to
* copyright by Wave Software. Only employees of the company, or other
* cooperating entities responsible for developing, maintaining and implementing
* this code shall be entitled to inspect the contents of the file. If you are
* not one of them, delete the file and let us know about a possible theft
* attempt by e-mail to: This file may not be reproduced,
* used in whole or in part, by persons not listed above. If you need
View gist:3804578
window.wave = window.wave || {};
//noinspection ThisExpressionReferencesGlobalObjectJS
wave.env = this;
wave.Loader = (function (window) {
"use strict";
var out, instance;
out = function(window) {
cardil / gist:2355211
Created Apr 10, 2012
CrontabManager simple example
View gist:2355211
use php\manager\crontab\CrontabManager;
$crontab = new CrontabManager();
$job = $crontab->newJob();
$job->on('* * * * *');
$job->onMinute('20-30')->doJob("echo foo;");
$job->onMinute('35-40')->doJob("echo bar;");
You can’t perform that action at this time.