Skip to content

Instantly share code, notes, and snippets.

View mlamina's full-sized avatar

Marco Lamina mlamina

View GitHub Profile
@mlamina
mlamina / quartz_apscheduler.py
Last active February 2, 2024 22:17
Python script to transform Quartz CRON expressions into APScheduler CronTrigger
from datetime import datetime, timedelta
from apscheduler.triggers.cron import CronTrigger
class QuartzExpressionParser:
"""Parser for converting Quartz CRON expressions to APScheduler kwargs.
This class takes into account the special characters used in Quartz ('L', 'W', and '#')
and translates them into the format that APScheduler understands.
"""
Client Version: version.Info{Major:"1", Minor:"1", GitVersion:"v1.1.1", GitCommit:"92635e23dfafb2ddc828c8ac6c03c7a7205a84d8", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"1", GitVersion:"v1.1.2", GitCommit:"3085895b8a70a3d985e9320a098e74f545546171", GitTreeState:"clean"}
@mlamina
mlamina / definition.yaml
Created November 20, 2015 08:58
YAML Definition of my Kubernetes service, including load balancer IP
kind: Service
apiVersion: v1
metadata:
name: api-lb
namespace: production
labels:
app: backend
role: api
component: ssl-proxy-service
spec:
@mlamina
mlamina / service-object.yaml
Created November 20, 2015 08:55
Result of 'kubectl get service api-lb --namespace=production -o yaml'
apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2015-11-20T08:49:10Z
labels:
app: backend
component: ssl-proxy-service
role: api
name: api-lb
namespace: production
@mlamina
mlamina / README.txt
Last active August 29, 2015 14:11
Script for running the NUMA-aware RW lock benchmarks
1. Download benchmark code: https://github.com/azu-labs/rw-numa-locks/
2. Build the benchmark executables with "make"
3. Copy run.sh into the folder with the executables
4. (optional) Adjust the parameters in the script
5. ./run.sh
2013-04-11T14:18:34.714600+00:00 app[worker.1]: heroku-javaagent: JVM Memory Usage (Heap): used: 247M committed: 349M max:349M
2013-04-11T14:18:34.714730+00:00 app[worker.1]: heroku-javaagent: JVM Memory Usage (Non-Heap): used: 33M committed: 33M max:219M
2013-04-11T14:18:34.714819+00:00 app[worker.1]: heroku-javaagent: JVM Threads : total: 31 daemon: 20 non-daemon: 2 internal: 9
2013-04-11T14:18:34.909783+00:00 app[web.1]: heroku-javaagent: JVM Memory Usage (Heap): used: 61M committed: 351M max:351M
2013-04-11T14:18:34.910116+00:00 app[web.1]: heroku-javaagent: JVM Memory Usage (Non-Heap): used: 37M committed: 37M max:219M
2013-04-11T14:18:34.910310+00:00 app[web.1]: heroku-javaagent: JVM Threads : total: 31 daemon: 13 non-daemon: 9 internal: 9
@mlamina
mlamina / gist:4945142
Created February 13, 2013 14:56
Installationsanleitung für "Cellist", eine prototypische Implementierung eines Lifecycle-Tools zur Unterstützung bei der Versionsverwaltung mit Metacello.
1. Clean Pharo 1.4 Image: http://www.pharo-project.org/pharo-download
2. Metacello Beta Preview & Cellist installieren: https://gist.github.com/kaihowl/31f0714d8979f03f9c03
3. Klick in World
4. "Open Cellist"
@mlamina
mlamina / gist:4944759
Created February 13, 2013 13:55
Example usage of UITheme builder in Pharo
open
| builder content |
builder := UITheme builder.
content := builder
newColumn:
{(builder newText:('Packages of {1}' format: {project})).
(builder
newListFor: self
list: #dependencies
selected: #selectedDependency
@mlamina
mlamina / gist:4944733
Last active December 13, 2015 16:59
Finding class dependencies for a Smalltalk package
findAllClassDependencies
| classDeps pi |
classDeps := Dictionary new.
pi := PackageOrganizer default packageNamed: self package ifAbsent: [^self error: 'Package not loaded'].
"find super class references"
pi classes do:[:pkgClass|
(classDeps at: (pkgClass) name
ifAbsentPut:[OrderedCollection new]) add:
@mlamina
mlamina / gist:4663133
Created January 29, 2013 09:56
Finding package dependencies for a package name
"Create a Dictionary mapping the selected package's classes to their dependencies. Code stolen from class DependencyBrowser#computePackageDependencies"
| pi classDeps packageDeps pkgName allPackages|
Transcript clear.
pkgName :='Violoncello-Core'.
classDeps := Dictionary new.
packageDeps := Dictionary new.
allPackages := OrderedCollection new.
pkgName ifNil:[^self error: 'No package specified'].
pi := PackageOrganizer default packageNamed: pkgName ifAbsent:[^self error: 'Package ',pkgName,' not loaded']. "unloaded"