Skip to content

Instantly share code, notes, and snippets.

View dasginganinja's full-sized avatar

Tom Donahue dasginganinja

  • Lehigh University
  • Bethlehem, PA
View GitHub Profile
@smashnet
smashnet / gitlab-artifacts-cleanup.py
Last active September 29, 2023 10:34 — forked from Pingu501/gitlab-artifacts-cleanup.py
GitLab Artifacts Clean-Up
"""
This is a small python script to clear up old gitlab build artifacts.
There are 3 variables you should modify:
* base_url: path to your gitlab
* access_token: your personal access token to make gitlab api calls
* delete_everything_older_than: configure the timedelta as you wish
!!IMPORTANT!!
By default this script does only make dry-runs and does not actually delete any files!
#0 d8 site: node/1 comment form with full html input format by uid0.
<script>alert('XSS')</script>
_________________________________________________________________________________________________
#1 d8 site: node/1 comment form with full html input format by uid0.
It will move the site into maintenance mode
<script>setTimeout(function(){
jQuery.get('/drupal_test/admin/config/development/maintenance',
function (data, status) {
if (status == 'success') {
@LauLaman
LauLaman / Mojave-nfs.md
Last active May 28, 2021 18:01
Vagrant nfs mount Mac OS X Mojave
  1. Mac OS X system settings > Security & Privacy > privacy tab

  2. Select Full Disk Access and click plus icon.

  3. Add terminal in the list ( in my case iTerm)

  4. Restart iTerm

  5. Run command in iterm: $ cd /private/etc && sudo touch ./exports

  6. Start virtual machine trough vargrant: Profit

@mogtofu33
mogtofu33 / MY_D8_THEME.theme
Last active August 24, 2022 09:24
Drupal 8 block theme suggestion based on block type, region, provider and display.
<?php
/**
* @file
* Preprocess and suggestions for a Drupal sub-theme.
*
*/
use Drupal\node\NodeInterface;
use Drupal\media\MediaInterface;
@illepic
illepic / particle-deps.sh
Last active May 18, 2022 21:50
Particle from scratch with all dependencies
#!/usr/bin/env bash
# 1. Skip steps if you already have the tools listed
# 2. Run source ~/.bashrc or source ~/.zshrc after each step to ensure command is registered
# Install Homebrew, if not installed
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Update Homebrew installed packages
brew update && brew upgrade
@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@jasodeep
jasodeep / install-sass-and-compass
Created December 2, 2016 20:05
Install Sass & Compass on debian
sudo aptitude install ruby-full
sudo gem install sass
sudo gem install compass
@leahtard
leahtard / node.twig.html
Last active June 9, 2022 18:32
Get file url in node for Drupal 8 twig template
{# Get URL of single file field #}
{{ node.field_file.entity.uri.value }}
{# Get URL of multi file field #}
{{ node.field_file['#items'].entity.uri.value }}
{# Trun into link #}
{{ file_url(node.field_file.entity.uri.value) }}
{# Check if there is at least one value #}
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm