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 /
Last active Oct 1, 2019
[Draft] JEP - Change name of imported type (aliasing)


Change name of imported type (aliasing)


The goal is to make code more productive and clean in cases where multiple classes with same name must be used in code. It should relief a developers frustration in that

cardil /
Last active Jan 15, 2019
Bill of Materials (BOM) dla JS [PL]

Chciałem opisać koncept pracy nad dużym projektem. Wyobraźmy sobie duży projekt, wiele osób, wiele zakresów biznesowych, wiele osobnych backendów, wszystko powinno być zintegrowane do jednej spójnej aplikacji. Przy takim projekcie proponowałbym pracę w z użyciem projektu BOM (Bill of Materials).

Ten koncept wywodzi się z skomplikowanych projektów ze świata Java.

Poniżej graf przedstawiający taką strukturę.

View Example fact with error checking.rb do
setcode do
output = Facter::Util::Resolution.exec('pgsql listdb')
if $?.success?
status: :ok,
list: output.split("\n")
raise output
cardil / modules.rb
Created Feb 21, 2018
Example custom fact for Facter 3+ with 2 implementations
View modules.rb
Facter.add(:modules) do
setcode { simple }
def simple
codedir = Facter::Core::Execution.exec('puppet config print codedir')
list = Facter::Core::Execution.exec("ls #{codedir}/modules").split("\n")
count: list.size,
list: list.freeze
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
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 / 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 /
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 / 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 / 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');
You can’t perform that action at this time.