Skip to content

Instantly share code, notes, and snippets.

View halyph's full-sized avatar
:octocat:
🇺🇦🤝🇩🇪

Orest Ivasiv halyph

:octocat:
🇺🇦🤝🇩🇪
View GitHub Profile
@halyph
halyph / import.rb
Last active August 29, 2015 14:15 — forked from baldowl/import.rb
Import Blogger into Octopress
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@halyph
halyph / build.gradle
Last active August 29, 2015 14:14 — forked from glaforge/build.gradle
apply plugin:'groovy'
apply plugin:'idea'
repositories { mavenCentral() }
dependencies {
groovy 'org.codehaus.groovy:groovy-all:1.8.4'
}
task makeDirs(description:'make all dirs for project setup') << {
0. SSH to server
1. Edit /opt/bitnami/apps/jenkins/jenkins_home/config.xml
2. set userSecurity to false: <userSecurity>false</userSecurity>
3. delete
<authorizationStrategy> and <securityRealm>
4. /etc/init.d/bitnami restart
// A simple Groovy script running a BPMN 2.0 process with the Activiti engine (http://www.activiti.org/).
// One of the tasks contains a Groovy script!
// Resources:
// Activiti, http://www.activiti.org/
// http://www.jorambarrez.be/blog/2010/08/09/hello_world_on_mysql/
// http://www.javabeat.net/articles/print.php?article_id=362
// H2, http://www.h2database.com/
@GrabResolver(name='activiti.repo', root='http://maven.alfresco.com/nexus/content/repositories/activiti/')
@halyph
halyph / grep_alias.sh
Last active December 18, 2015 03:49
grep with color
alias grep='grep --color=always -C 10 -ni'
@halyph
halyph / App.java
Created May 14, 2013 16:02
Generate DataMatrix, inline it in PDF and read generate DataMatrix
package org.halyph.barcode;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@halyph
halyph / gist:5378331
Last active January 25, 2018 20:52
Calculate PDF Table Row Heights with iTextSharp (link) [http://kuujinbo.info/iTextSharp/rowHeights.aspx]
public static float TotalRowHeights(
Document document, PdfContentByte content,
PdfPTable table, params int[] wantedRows)
{
float height = 0f;
ColumnText ct = new ColumnText(content);
// respect current Document.PageSize
ct.SetSimpleColumn(
document.Left, document.Bottom,
document.Right, document.Top
@halyph
halyph / ColumnText.java
Created April 13, 2013 11:40
Sample ColumnText with Table. Calculate if table is fully rendered on the current page
/*
* This class is part of the book "iText in Action - 2nd Edition"
* written by Bruno Lowagie (ISBN: 9781935182610)
* For more info, go to: http://itextpdf.com/examples/
* This example only works with the AGPL version of iText.
*/
package part1.chapter03;
import java.io.FileOutputStream;
@halyph
halyph / postbuild.groovy
Last active April 5, 2019 13:58
Jenkins Groovy Postbuild script
import hudson.model.*
import com.tikal.jenkins.plugins.multijob.*;
void log(msg) {
manager.listener.logger.println(msg)
}
threshold = Result.SUCCESS
void aggregate_results() {
@halyph
halyph / consoleText
Created January 23, 2013 17:03
Sample Jenkins aggregated job status
Started by user anonymous
Building in workspace C:\Users\oivasiv\.jenkins\jobs\Main_Job\workspace
Starting build job Job_Set_1.
Finished Build : #8 of Job : Job_Set_1 with status :SUCCESS
Starting build job Job_Set_2.
Finished Build : #8 of Job : Job_Set_2 with status :SUCCESS
---------------------------------------------------------------------------------------------------------------
Aggregated status report
---------------------------------------------------------------------------------------------------------------
Main_Job #8 - SUCCESS