Skip to content

Instantly share code, notes, and snippets.

View Cyclodex's full-sized avatar

Fabian Gander Cyclodex

View GitHub Profile
@Cyclodex
Cyclodex / create-clone-all.ps1
Created December 29, 2021 10:22
Collects all git repositories and creates a clone script out of it
$FILENAME = "clone-all-repos.ps1"
Write-Output "# extracted git clone commands" | Out-File -FilePath "$FILENAME"
Get-ChildItem . -Attributes Directory+Hidden -ErrorAction SilentlyContinue -Filter ".git" -Recurse | ForEach-Object {
$DIR_NAME = $_.Parent.Name
$DIR = Resolve-Path -Path $_.Parent.FullName -Relative
$GIT_DIR = "$DIR/.git"
Write-Output "" | Out-File -FilePath "$FILENAME" -Append
Write-Output "# $DIR_NAME" | Out-File -FilePath "$FILENAME" -Append
@Cyclodex
Cyclodex / colors.js
Last active August 1, 2019 09:22
console color sequences
Reset = "\x1b[0m"
Bright = "\x1b[1m"
Dim = "\x1b[2m"
Underscore = "\x1b[4m"
Blink = "\x1b[5m"
Reverse = "\x1b[7m"
Hidden = "\x1b[8m"
FgBlack = "\x1b[30m"
FgRed = "\x1b[31m"
@Cyclodex
Cyclodex / Galaxy-Gitlab-Textarea-full-width.user.js
Created September 20, 2017 13:13
Make the textarea field on gitlab (nothing galaxy) full width
// ==UserScript==
// @name Galaxy/Gitlab: Wider editing window
// @namespace Cyclodex
// @version 0.1
// @description Increase the editing text-area for big screens on (gitlab on galaxy)
// @author Cyclodex <cyclodex@nothing.ch>
// @match https://galaxy.nothing.ch/*/issues/*
// @grant none
// ==/UserScript==
(function() {
@Cyclodex
Cyclodex / gist:70378e2f3f72a91fc55d2913404fcde0
Created June 14, 2017 15:33
Drupal cleanup old modules when missing from file system
/**
* Delete {system} records for long-lost modules.
*/
function HOOK_update_7100() {
$modules = array(
'module1',
'module2',
'module3',
);
db_delete('system')
@Cyclodex
Cyclodex / paragraphsBUEditor.behaviors.js
Created October 4, 2016 14:09
Drupal JS behaviors: Bueditor: Adding toolbar to ajax added textfields (otherwise they are missing)
(function($, BUE) {
'use strict';
// Don't setup the behavior on pages without BUEditor.
if (typeof BUE ==='undefined') {
return;
}
/**
* New behavior to handle BUEditors text areas added dynamically
@Cyclodex
Cyclodex / pictureMapping.behaviors.js
Created October 4, 2016 14:08
Drupal JS behaviors: Picture mapping helper, hiding focal point information and focusing user on focal point when needed.
(function ($) {
Drupal.behaviors.PictureMapping = {
attach: function (context, settings) {
/**
* Update function which helps to change the states
* @param selectMapping
* @param imagePreview
*/
function updateVisibility(selectMapping, imagePreview) {
@Cyclodex
Cyclodex / textFormatImprovements.behaviors.js
Created October 4, 2016 14:06
Drupal JS behaviour: Hide text format information, openable on "more info" link.
(function ($) {
Drupal.behaviors.TextFormatImprovments = {
attach: function (context, settings) {
// help removing the text-markup infos
// hide all guides and also the text formatter selection
$('.form-type-select', '.text-format-wrapper').hide();
$('.filter-guidelines', '.text-format-wrapper').hide();
// make the info link opening the guides
var FilterGuidesLink = $('.filter-help', '.text-format-wrapper');
FilterGuidesLink.click(function(e){
@Cyclodex
Cyclodex / Trac-Wiki-Add-attachment-links.user.js
Last active September 9, 2016 13:03
Trac attachment helper