Skip to content

Instantly share code, notes, and snippets.

View jesgs's full-sized avatar
🍜
Ramen connoisseur

Jess Green jesgs

🍜
Ramen connoisseur
View GitHub Profile
DELIMITER |
CREATE PROCEDURE explode( pDelim VARCHAR(32), pStr TEXT)
BEGIN
DROP TABLE IF EXISTS temp_explode;
CREATE TEMPORARY TABLE temp_explode (id INT AUTO_INCREMENT PRIMARY KEY NOT NULL, word VARCHAR(40));
SET @sql := CONCAT('INSERT INTO temp_explode (word) VALUES (', REPLACE(QUOTE(pStr), pDelim, '\'), (\''), ')');
PREPARE myStmt FROM @sql;
EXECUTE myStmt;
END |
@jesgs
jesgs / correctLineWidth.py
Created July 25, 2016 00:59
Correct LineWidth values for ToonShader nodes for Poser 7 and earlier. Poser versions prior to 8 handled the LineWidth node value differently than Poser 8 and later. This script allows you to batch-correct the line-value, saving the effort of having to click on every single material.
# Correct LineWidth values for ToonShader nodes for Poser 7 and earlier
#
# Poser versions prior to 8 handled the LineWidth node value differently
# than Poser 8 and later. This script allows you to batch-correct the line-value,
# saving the effort of having to click on every single material.
import poser
scene = poser.Scene()
actor = scene.CurrentActor()

Matcha Green Tea Mug Cake

Picture on Instagram

Tools:

Favorite large mug. Soup mug would be ideal.

Ingredients:

  • 4 tbs flour (sifted)
  • 2 tbs sugar
<?php
/**
* Change order parameter
* @param WP_Query $query WP query object
*/
function mangapress_change_archive_order($query)
{
$query->query['order'] = 'ASC';
}
add_action('pre_get_posts', 'mangapress_change_archive_order')
@jesgs
jesgs / login-styles-removal.php
Last active August 29, 2015 14:23
A method for removing all default styles from WordPress login screen.
<?php
/**
* Remove all WordPress-specific stylesheets from WordPress login screen
*/
/**
* Force-remove login-related styles. Can't use the regular method of login_enqueue_scripts
* due to wp_admin_css running before login_enqueue_scripts
*
@jesgs
jesgs / fcserver.json
Created May 13, 2015 00:22
fcserver config for working with 12mm LEDs (strands of 50)
{
"listen": [ null, 7890 ],
"verbose": true,
"color": {
"gamma": 2.5,
"whitepoint": [ 0.9, 0.9, 0.9 ]
},
"devices": [
{
"type": "fadecandy",
@jesgs
jesgs / parse_xlsx.php
Last active August 29, 2015 14:19 — forked from searbe/parse_xlsx.php
<?php
/**
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!)
* but the usual tools were hitting the memory limit pretty quick. I found that
* manually parsing the XML worked pretty well. Note that this, most likely,
* won't work if cells contain anything more than text or a number (so formulas,
* graphs, etc ..., I don't know what'd happen).
*/
@jesgs
jesgs / 00-README.md
Last active August 29, 2015 14:18
Working with WordPress's Metadata API

Working with WordPress's Metadata API

This tutorial describes how to work with the WordPress Metadata API as described in the tutorial (Working with WordPress's Metadata API) posted on my blog.

@jesgs
jesgs / 00-blinker-fadecandy-js-readme.md
Last active August 29, 2015 14:18
Node.js-version of Arduino code for Spooky LED Eyes (on Adafruit)
@jesgs
jesgs / locate-template.php
Created February 6, 2015 20:37
WordPress locate_template example
<?php
/**
* Theme view template example using locate_template
*
* @return string
*/
function my_theme_template()
{
// do view related stuff