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 / gist:2636387
Created May 8, 2012 15:34
Animation Routine
function animate(fx) {
/****************************************************************************************************
* Animation primer.
* The callback function must return false when the animation has to end, true oterwise.
* The function inject a time variable in milliseconds.
*
* https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame
* http://www.goat1000.com/2011/04/07/mozrequestanimationframe-and-webkitrequestanimationframe.html
*/
var aloop;
@folletto
folletto / gist:2001797
Created March 8, 2012 16:10
Dynamically parse a string to a DOM to be used with jQuery. It's very useful because it allows to parse non-XML content (either XML not declared as such or HTML)
_updateBody: function(str) {
/****************************************************************************************************
* This function creates a new document object to be used to parse a HTML string.
*
*/
var domDocument = document.implementation.createHTMLDocument();
var range = domDocument.createRange();
range.selectNode(domDocument.body);
var documentFragment = range.createContextualFragment(str);
@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/
*/