Skip to content

Instantly share code, notes, and snippets.

Avatar

Konstantinos Margaritis margaritis

View GitHub Profile
@margaritis
margaritis / cleanupJenkinsWorkspaces.groovy
Created Nov 11, 2018 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
A jenkins script to clean up workspaces on slaves
View cleanupJenkinsWorkspaces.groovy
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
@margaritis
margaritis / gist:38510e5ba3561edda0e4f38a4aa53ba8
Created Nov 11, 2018 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
View gist:38510e5ba3561edda0e4f38a4aa53ba8
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@margaritis
margaritis / jenkins-clean-slave-workspaces.groovy
Created Nov 11, 2018 — forked from stuartcampbell/jenkins-clean-slave-workspaces.groovy
A jenkins script to clean up workspaces on slaves which have < 10GB of free space
View jenkins-clean-slave-workspaces.groovy
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
View waitForKeyElements.js
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
View README.md

triggerEvent

Cross-browser function to trigger DOM events.

View app.js
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

View encrypted-git-repo.md

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes