Skip to content

Instantly share code, notes, and snippets.

View Ithildir's full-sized avatar

Andrea Di Giorgi Ithildir

View GitHub Profile
@Ithildir
Ithildir / clone-all.sh
Created March 19, 2019 16:25
Clone all repositories in a GitHub organization
#!/bin/bash
ORG=XXX
GITHUB_USER=XXX
GITHUB_TOKEN=XXX
SEARCH_TERM='ssh_url'
SSH_REGEX='s#.*\(git*@[^"]*\).*#\1#;p'
function get_repos {
@Ithildir
Ithildir / create-withings-weight-csv.js
Created January 10, 2019 04:23
Convert MS Health weights JSON into CSV for Withings Healtmate
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const CHUNK_SIZE = 250;
const pad = n => n < 10 ? `0${n}` : n;
const formatDate = d => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
@Ithildir
Ithildir / build.gradle
Created September 3, 2016 00:35
Exclude snapshots on range dependencies
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme
apply plugin: "java"
apply plugin: "maven"
group = "com.example"
String installVersion = System.getProperty("installVersion")
if (installVersion) {
@Ithildir
Ithildir / ci.tdump
Created November 18, 2015 22:19
GRADLE-3027 in Gradle 2.8
2015-11-17 06:34:07
Full thread dump Java HotSpot(TM) Server VM (24.79-b02 mixed mode):
"Attach Listener" daemon prio=10 tid=0x0af01800 nid=0x9fb waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Task worker Thread 7" prio=10 tid=0x096f5400 nid=0x7e1a waiting on condition [0x067f8000]
@Ithildir
Ithildir / netbeans.gradle
Created November 16, 2015 19:35
Add a task to a Gradle multi-project build via init-script
// Call with gradlew --init-script=S:/temp/netbeans.gradle printDependencies
allprojects {
task printDependencies << {
["runtime", "testIntegrationRuntime"].each {
Configuration configuration = configurations.findByName it
if (configuration) {
configuration.files.each {
println it
@Ithildir
Ithildir / build.gradle
Created October 30, 2015 23:38
Block snapshot and dynamic dependencies in Gradle projects
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme
task resolveStuff
defaultTasks = ["resolveStuff"]
def versionSelectorScheme = gradle.services.get(VersionSelectorScheme)
configurations {
all {
@Ithildir
Ithildir / build.gradle
Last active October 30, 2015 23:55
Shareable Eclipse project files in Gradle
import groovy.xml.*
apply plugin: "eclipse"
apply plugin: "java"
task copyLibs(type: Copy)
configurations {
libs
}