Skip to content

Instantly share code, notes, and snippets.

View kenanhancer's full-sized avatar
🎯
Focusing

kenan hancer kenanhancer

🎯
Focusing
View GitHub Profile
MASTER_NODE_IP="192.168.33.10"
WORKER_NODE_IP_START="192.168.33.10"
Vagrant.configure("2") do |config|
config.vm.define "masternode" do |node|
node.vm.box = "ubuntu/xenial64"
node.vm.hostname = "masternode"
public static class TPLExtensions
{
public static async Task<TResult[]> ForEachConcurrentAsync<TItem, TResult>(this IEnumerable<TItem> enumerable, Func<TItem, Task<TResult>> action, int? maxDegreeOfParallelism = null)
{
if (maxDegreeOfParallelism.HasValue)
{
using (var semaphoreSlim = new SemaphoreSlim(maxDegreeOfParallelism.Value, maxDegreeOfParallelism.Value))
{
var tasksWithThrottler = new List<Task<TResult>>();
@kenanhancer
kenanhancer / UninstallVagrant.sh
Created July 21, 2018 17:03
Uninstall Vagrant on Ubuntu
//Uninstall just vagrant
//This will remove just the vagrant package itself.
sudo apt-get remove vagrant
//Uninstall vagrant and its dependencies
//To remove the vagrant package and any other dependant package which are no longer needed from Ubuntu.
sudo apt-get remove --auto-remove vagrant
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Collections.Concurrent;
using System.Text;
using System.Threading.Tasks;
namespace PubSubTest1
{
class Program
using StackExchange.Redis;
using System;
using System.Threading.Tasks;
namespace CSharp_From_EAP_To_TAP_With_Redis_PubSub
{
class Program
{
static SimphonyService _simphonyService;
static BroccoliService _broccoliService;
//Stop all Docker containers
docker stop $(docker ps -a -q)
//Kill all Docker containers
docker kill $(docker ps -q)
//Remove all Docker containers
docker rm $(docker ps -a -q)
//Remove all Docker images
@kenanhancer
kenanhancer / Jenkinsfile
Last active July 12, 2018 20:29
Jenkinsfile which publish npm package by versioning with BUILD_NUMBER
import org.eclipse.jgit.transport.URIish
def repositoryPath = "kenan.visualstudio.com/DefaultCollection/TestProject/_git/IconSet"
def url = "https://$repositoryPath"
def branch = "master"
def credentialsId = '44995f55-2f49-4cad-905d-b06c32b5e5bd'
node {
stage('Initialize'){
@kenanhancer
kenanhancer / Jenkinsfile
Last active January 12, 2022 20:16
Jenkinsfile which publish npm package and push to git
import org.eclipse.jgit.transport.URIish
def repositoryPath = "kenan.visualstudio.com/DefaultCollection/TestProject/_git/IconSet"
def url = "https://$repositoryPath"
def branch = "master"
def credentialsId = '44995f55-2f49-4cad-905d-b06c32b5e5bd'
node {
stage('Initialize'){
System.out.println("Hello world!");
System.out.println("Hello world!")
System.out.println "Hello world!"
println("Hello world!");
println("Hello world!")
println "Hello world!"
def name = "John"
class Person {
constructor(personId, firstName, lastName, age, gender) {
this.personId = personId;
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.gender = gender;
}
getFullName() {