Skip to content

Instantly share code, notes, and snippets.

View jackmakesthings's full-sized avatar
🌙

jack jackmakesthings

🌙
View GitHub Profile
// Facetwp A11Y Pager
function fs_a11y_facetwp_pager_html( $output, $params ) {
$output = '';
$page = $params['page'];
$total_pages = $params['total_pages'];
if ( 1 < $total_pages ) {
@gayathrics
gayathrics / facetwp-selections-html.js
Created April 13, 2018 17:45
use this snippet to customize the facetwp selections html markup
//reference: \wp-content\plugins\facetwp\assets\js\front.js - Generate the user selections
wp.hooks.addAction('facetwp/loaded', function () {
// add custom code here
var selections = '';
jQuery.each(FWP.facets, function (key, val) {
if (val.length < 1 || 'undefined' === typeof FWP.settings.labels[key]) {
return true; // skip this facet
}
var choices = val;
@ffoodd
ffoodd / mu-fSelect.js
Created December 4, 2017 13:27
FacetWP accessibility improvements
(function($) {
$.fn.fSelect = function(options) {
if ('string' === typeof options) {
var settings = options;
}
else {
var settings = $.extend({
placeholder: 'Select some options',
func tileset_from_scene(scene, library, merge):
"""
@scene Node - The input scene
@library TileSet - The output tileset
@merge bool - Preserve old tiles
"""
if merge:
library.clear()
for child in scene.get_children():
#..global save func
func save_hero(hero):
#grab data
var data = hero.get_package()
#init save file
var save = File.new()
var path = 'res://data/heroes/'+hero.get_name()+'.zd'
save.open(path,File.WRITE)
#save data
save.store_line(data.to_json())
@escapedcat
escapedcat / package.json
Last active May 16, 2018 09:39
npm scripts including node-sass and autoprefixer
{
"name": "foo",
"version": "1.0.0",
"description": "foo project",
"main": "index.js",
"scripts": {
"start": "npm run serve | npm run watch-css",
"serve": "./node_modules/.bin/http-server -p 8080",
"build-css": "./node_modules/node-sass/bin/node-sass app/sass/style.scss -o app/css/ && ./node_modules/postcss-cli/bin/postcss --use autoprefixer app/css/style.css -d app/css/",
"watch-css": "nodemon -e scss -x 'npm run build-css'"
@remy
remy / jira-tweaks.css
Created February 4, 2016 12:50
Jira CSS tweaks - to make it more bearable to work with
/* keep the toolbar in it's position and don't let it float */
#jira #stalker {
position: relative !important;
top: auto !important;
}
/* on individual issues: hide the floating toolbar (in favour of keeping it at the top of the page) */
#jira .stalker-placeholder.issue-header.js-stalker {
display: none !important;
}
extends Sprite
var grid_size = 32
var speed = 64 # speed in pixels per second
var direction = Vector2(1, 0) # move in positive x direction, adapt this in your code for other directions
var is_moving = false
var moved_dist # keep track of how much we already moved
func _fixed_process(delta):
if Input.is_action_pressed("myInputAction") and !is_moving:
extends Control
var game
var current_event = 0
var event_object = {-1: null}
# EVENT SENSORS
extends Node
var exit_block = load("res://scenes/exit_confirmation.scn")
var open = false
var confirmation = null
var create = false