Skip to content

Instantly share code, notes, and snippets.

Godot Scene Manager

Simple scene manager with simple transition effects using RPG Maker greyscale images. Doesn't do async loading at all, but that's fine for small games that just want a little pizzaz to their visuals. Just drop the file into your project and add it to your Autoloads. Then start doing SceneManager.change_scene('res://myscene.tscn') instead of get_tree().change_scene('res://myscene.tscn') and you'll be good to go.

@phlbnks
phlbnks / products_with_category.sql
Last active December 18, 2020 23:11
Select Product name, SKU, price and category from WordPress / WooCommerce with MySQL query
SELECT
wp_posts.post_title AS Product,
wp_postmeta1.meta_value AS SKU,
wp_postmeta2.meta_value AS Price,
GROUP_CONCAT( wp_terms.name ORDER BY wp_terms.name SEPARATOR ', ' ) AS ProductCategories
FROM wp_posts
LEFT JOIN wp_postmeta wp_postmeta1
ON wp_postmeta1.post_id = wp_posts.ID
AND wp_postmeta1.meta_key = '_sku'
LEFT JOIN wp_postmeta wp_postmeta2
@MikeNGarrett
MikeNGarrett / wp-config.php
Created October 14, 2017 01:56
Disable admin-ajax on the front-end of WordPress sites and cache the resulting 404.
<?php
if(
strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false &&
strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false
) {
header( 'Cache-Control: max-age=30000, must-revalidate' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' );
header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" );
die;
@gjones
gjones / fetchResultsFromApi.swift
Created May 5, 2017 22:39
JSON API with Basic Auth in Swift 3
func fetchResultsFromApi() {
let username = "username"
let password = "password"
let url = NSURL(string: "http://localhost:3000/api/v1/results.json")
let request = NSMutableURLRequest(url: url! as URL)
let config = URLSessionConfiguration.default
let userPasswordString = "\(username):\(password)"
let userPasswordData = userPasswordString.data(using: String.Encoding.utf8)
@kiki67100
kiki67100 / gist:f5b421ddac9d500297b0e6471e5ef737
Created February 23, 2017 08:19
Fix ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY nginx
#Fix ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY on NGINX / SSL / SPD
#Tested on Plesk 17 NGINX / SDPY / LETSENCRYPT
#To reproduce this error you can check on Windows 7 / Chrome 47 https://www.browserling.com/
#Add this in server
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
@marcuswestin
marcuswestin / git-count-commits.sh
Created June 15, 2012 01:22
How many git commits did I make today?
git log --pretty=oneline --author=Marcus --since=yesterday | wc
@romulodl
romulodl / caralho.php
Created November 9, 2011 02:41
Wordpress workaround to Facebook's like button bug (?fb_xd_fragment=$)
<?php
/**
* @package Caralho!
* @version 1.6
*/
/*
Plugin Name: CARALHO
Plugin URI: http://pudim.com.br
Description: (CARALHO == portuguese of FUCK). If you are getting a blank page because of the "?fb_xd_fragment=$" in your URI, this plugin could be your solution!
Author: CARALHO!