Skip to content

Instantly share code, notes, and snippets.

Tamas Gal tamasgal

View GitHub Profile
@tamasgal
tamasgal / gcn_pipeline.py
Last active Feb 10, 2020
ThePipe example for gcn
View gcn_pipeline.py
#!/usr/bin/env python
from queue import Queue, Empty
import gcn
from grbfunk import handler
import coloredlogs, logging
import telegram
import os
import yaml
@tamasgal
tamasgal / Jenkinsfile
Created May 29, 2018
Getting a list of filenames in a given directory
View Jenkinsfile
#!groovy
import static groovy.io.FileType.FILES
node('master') {
FILES_DIR = './foo'
cleanWs()
sh """
mkdir foo
touch foo/bar1
@tamasgal
tamasgal / Jenkinsfile
Created Apr 27, 2018
Jenkinsfile for parallel Docker images (Python)
View Jenkinsfile
#!groovy
def docker_images = ["python:3.5.5", "python:3.6.4", "python:3.6.5"]
def get_stages(docker_image) {
stages = {
docker.image(docker_image).inside {
// If I use this variable as the Virtual Env Folder,
// I get "permission denied" messages from pip, since it tries
// to install into /usr/local/... instead of the pyenv folder!
// def PYTHON_VENV = docker_image.replaceAll('[:.]', '') + 'venv'
@tamasgal
tamasgal / ParallelDockerJenkinsfile
Last active Jan 5, 2020
Looping through a list of docker images and execute their stages in parallel. More info here: https://stackoverflow.com/questions/49782267/running-multiple-docker-containers-from-a-single-jenkinsfile
View ParallelDockerJenkinsfile
def docker_images = ["python:2.7.14", "python:3.5.4", "python:3.6.2"]
def get_stages(docker_image) {
stages = {
docker.image(docker_image).inside {
stage("${docker_image}") {
echo 'Running in ${docker_image}'
}
stage("Stage A") {
switch (docker_image) {
@tamasgal
tamasgal / Jenkinsfile
Created Apr 12, 2018 — forked from oifland/Jenkinsfile
Loops in Jenkinsfiles
View Jenkinsfile
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@tamasgal
tamasgal / hdf5_simple.cpp
Created Mar 15, 2016 — forked from YukiSakamoto/hdf5_simple.cpp
simple example to write hdf5 using c++.
View hdf5_simple.cpp
#include <string>
#include <iostream>
#include "H5Cpp.h"
#define MAX_NAME_LENGTH 32
const std::string FileName("SimpleCompound.h5");
const std::string DatasetName("PersonalInformation");
const std::string member_age("Age");
const std::string member_sex("Sex");
const std::string member_name("Name");
@tamasgal
tamasgal / _.md
Created Mar 13, 2014
Tributary inlet
View _.md
You can’t perform that action at this time.