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 / 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;");
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 /
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 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
cardil / eid-in-ang.js
Created Jan 15, 2016
Example how to use Eid in Angular 1.x apps (featuring also business filters!)
View eid-in-ang.js
(function() {
'use strict';
var EidPreconditions = Eid.preconditions;
var checkNotNullable = EidPreconditions.checkNotNullable;
var checkArgument = EidPreconditions.checkArgument;
var tryToExecute = EidPreconditions.tryToExecute;
var app = angular.module('eid-in-ang', []);
var eidifyServiceCall = function(eid, target, operation) {
checkNotNullable(operation, "20160115:124506", 'Operation should not be nullable');
cardil / MainControllerSpec.groovy
Last active Feb 13, 2016
An example of proposed JavaSpec as a direct port of RSpec
View MainControllerSpec.groovy
import pl.wavesoftware.exampleapp.MainController
import static pl.wavesoftware.jspec.DSL.*
describe(MainController, {
let 'instance', { describedClass.newInstance }
sharedExamples('not throwing any errors', {
it { expect { subject }.notTo raiseError }
it { expect(subject).notTo beNull }
cardil /
Last active Mar 31, 2016
DozerProxyMapping prototype idea
ProxyConfigurator configurator = new ProxyConfigurator();
Mapping mapping = configurator.newMappingBuilder()
.from(User.class, (user) -> user.getRole().getName() )
.to(UserQuery.class, (query) -> query.getRoleName() )
cardil / change-ts-to-human-readable.groovy
Created Jun 30, 2016
Changing Date from timestame to human readable Date from String
View change-ts-to-human-readable.groovy
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
directory = args[0] // directory
d = Paths.get(directory)
stream = Files.newDirectoryStream(d)
stream.each {
p = it as Path;
println "file -> ${p}"
cardil / git-list-merged-branches
Last active May 16, 2017
git-list-merged-branches - A script that can find already merged branches and provide git command to remove them
View git-list-merged-branches
getopt --test > /dev/null
if [[ $? -ne 4 ]]; then
echo "I’m sorry, `getopt --test` failed in this environment."
exit 1
cardil / Vagrantfile
Created Sep 19, 2017
Example Vagrantfile to test puppet agent-server connections
View Vagrantfile
Vagrant.configure("2") do |config| = 'boxcutter/centos7'
config.vm.define :master do |m| "private_network", ip: ""
m.vm.provider "virtualbox" do |v|
v.memory = 768
v.cpus = 2
You can’t perform that action at this time.