Skip to content

Instantly share code, notes, and snippets.

@jdecaron
jdecaron / clone-all-gitlab-group-projects.sh
Created July 22, 2019 19:25
Clone all projects from a Gitlab group using a NodeJS interpreter
# One liner to clone all your group projects
# with a NodeJS interpreter. You need to substitute
# two things in this one liner: group, token.
curl -s https://gitlab.com/api/v4/groups/group/projects?private_token=token&search=&per_page=999 > gitlab.json && node -e "const repos = require('./gitlab.json'); const { execSync } = require('child_process'); repos.reduce((previous, repo) => { execSync('git clone ' + repo.ssh_url_to_repo); }, undefined)"
@jdecaron
jdecaron / clone-all-gitlab-group-projects.js
Last active July 22, 2019 19:27
Clone all projects from a Gitlab group using a NodeJS interpreter
const repos = require('./gitlab.json');
const { execSync } = require('child_process');
repos.reduce((previous, repo) => {
execSync('git clone ' + repo.ssh_url_to_repo);
}, undefined)
@jdecaron
jdecaron / httprequestdump.js
Created August 15, 2019 18:28
Change public Gist that dumps HTTP request and print direct to console instead of writing into file
'use strict';
let fs = require('fs'),
http = require('http'),
HOSTNAME =process.env.HOSTNAME || '0.0.0.0',
PORT = process.env.PORT || 8080,
ACK_HTTP_CODE = 200,
ACK_CONTENT_TYPE = 'text/plain',
@jdecaron
jdecaron / ip.js
Created September 15, 2022 20:09
Cloudflare Worker that returns the IP address
addEventListener('fetch', event => {
return event.respondWith(
new Response(event.request.headers.get('CF-Connecting-IP'))
)
})