Skip to content

Instantly share code, notes, and snippets.

View sp9usb's full-sized avatar

Kamil Myśliwiec sp9usb

View GitHub Profile
@sp9usb
sp9usb / jenkins-pipeline.groovy
Last active March 12, 2018 12:04
Groovy on Jenkins
loader = this.class.classLoader;
loader.addURL(new URL("file:/C:/Jenkins/custom-libs/Motorola.Macs.Jenkins.Helpers.jar"));
yamlHelper = loader.loadClass("Motorola.Macs.Jenkins.YamlHelper").newInstance("C:\\Jenkins");
println yamlHelper.getTestPaths(["Castle.Core.dll", "LiteDB.dll"])
@sp9usb
sp9usb / Vagrantfile
Last active February 26, 2018 20:00 — forked from tvjames/Vagrantfile
Prepare a Windows Server 2008 R2 instance for use with vagrant-windows.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@sp9usb
sp9usb / git_worktree.md
Last active January 15, 2018 17:40
git worktree

git worktree add -b hotfix ../hotfix origin/master

Polecenie powoduje:

  • -b hotfix – utworzenie nowej gałęzi o nazwie hotfix
  • ../hotfix – w katalogu sąsiednim do naszego repozytorium o nazwie hotfix
  • origin/master – na podstawie gałęzi origin/master
@sp9usb
sp9usb / ArgumentExceptions.cs
Created December 22, 2017 12:01
Generic exceptions concept
using System;
namespace Sm.Exceptions
{
public abstract class ArgumentExceptions : Exception
{
protected ArgumentExceptions() { }
protected ArgumentExceptions(string message) : base(message) { }
}
@sp9usb
sp9usb / Room.cs
Last active January 26, 2016 07:03
[EntityFramework] Many to many
public class Room
{
public Guid Id { get; set; }
public string Title { get; set; }
public virtual User Manager { get; set; }
public virtual ICollection<User> Members { get; set; }
}
@sp9usb
sp9usb / gist:5d240d44d7e266ae844f
Last active August 29, 2015 14:21
Linux Init.d install script
# VirtualBox installer shell routines
#
# Copyright (C) 2007-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
#!/bin/bash
# THESE ARE NOTES, NOT TESTED AS SCRIPT!
# We need the following to get and run teamcity agent
sudo apt-get install openjdk-7-jre-headless
sudo apt-get install unzip #For unzipping buildAgent.zip
# For compiling Simple.Web
sudo apt-get install ruby1.9.1
netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cassandra;
using Cassandra.Data;
using Cassandra.Data.Linq;
using metrics.Core;
using metrics.Reporting;
using System.Diagnostics;
var result = _repository.SystemGet(spec)
.GroupBy(g => g.SensorGuid, record => record, (guid, records) => records.OrderByDescending(r => r.Timestamp).FirstOrDefault())
.ToList();