Skip to content

Instantly share code, notes, and snippets.

View folletto's full-sized avatar

Erin Casali folletto

View GitHub Profile
@folletto
folletto / 0-details.txt
Last active May 27, 2020 02:08
Borderlands 3 broken and fixed Atlas HQ (JSON export)
Description:
https://www.reddit.com/r/borderlands3/comments/graqgv/i_fixed_my_crash_on_atlas_hq_via_command_line/
Export and re-import using:
https://github.com/apocalyptech/bl3-cli-saveedit
Verifying my Blockstack ID is secured with the address 1AvvoCDvKjrAbumDq8xCLUjBEH2jRRwyCe https://explorer.blockstack.org/address/1AvvoCDvKjrAbumDq8xCLUjBEH2jRRwyCe
@folletto
folletto / curl-tester.php
Last active April 27, 2017 10:19
Script to load a file listing URL pairs and checking it redirects from the first to the second
<?php
// This script loads a list of urls from "curl-tester.txt" file to check for 301 redirects.
// The file format is two URL (source, 301 redirection destination) separated by space.
$file_list = 'curl-tester.txt';
function get_urls_list_from_file( $file ) {
//$content = file_get_contents( $file );
$out = array();
$array = file( $file );
@folletto
folletto / wpdo
Created June 26, 2016 15:20
WordPress "DO" Command Line interface to simplify contribution to Core for non-Developers, done during WordCamp Europe Contributor Day (2016 Jun 26)
#!/usr/bin/env php
<?php
// ********************************************************************************
// PHP shell script to ease the setup and execution of make.wordpres.sorg patches
// ********************************************************************************
$INSTALL_FOLDER_NAME = 'wordpress-trunk';
$PATCH_FILE_NAME = '_wpdo_downloaded.patch';
@folletto
folletto / proxy.pac
Created April 8, 2015 08:53
A simple proxy auto-configuration file for local development.
function FindProxyForURL(url, host) {
if ( localHostOrDomainIs(host, "name.dev") ) {
return "PROXY 192.168.1.0:8888";
}
return "DIRECT";
}
@folletto
folletto / functions.php
Created March 12, 2015 18:04
Iterate on related posts
function loop_related_posts( $posts_per_page = 3, $category = null, $post_ID = 0 ) {
/****************************************************************************************************
* Get the post related to the current-looping post's matching tags.
* Creates its own loop.
*
* USAGE:
* <?php while ( loop_related_posts( 3 ) ) : ?>
* your standard template code
* <?php endwhile; ?>
*/
#!/usr/bin/php
<?php
function getAllDirectories( $base_dir, $list_hidden = false ) {
$out = array();
foreach ( new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_dir ) ) as $path ) {
// ****** Skip non-relevant files
$filename = basename( $path );
@folletto
folletto / walk-recursive-flatten-copy.js
Last active August 29, 2015 14:16
Script to iterate a directory structure and do stuff
#!/usr/bin/env node
/*
* General folder iterator plus filtering functions.
* Copyright (2015) Davide 'Folletto' Casali
* Released under GPLv2 License.
*
* USAGE:
* node move-flatten.js jpg ./from/ ./to/
*/
@folletto
folletto / functions.php
Created January 11, 2015 21:22
WordPress: Create a Custom Loop for Related Posts
<?php
/*
* Notes:
* 1. This isn't an universal function: you might have to add your own db field.
* I tried to keep just a few to optimize.
* 2. This is a more advanced function from the ones you usually find around, because it
* count the number of matching tags to sort the related articles, doesn't just query
* and sort for the most recent one with any of the tags.
*/
@folletto
folletto / mixin-ring-hover.scss
Last active August 29, 2015 14:10
SASS: Simple :hover animation mixin
/**
* Simple ring hover animation
*/
@mixin menus-hover-halo() {
position: relative;
&:after {
content: "";
pointer-events: none;
position: absolute;