Skip to content

Instantly share code, notes, and snippets.

View megamosk's full-sized avatar
🎯
Focusing

megamosk

🎯
Focusing
View GitHub Profile
@patric-boehner
patric-boehner / ReadMe.md
Last active October 8, 2020 11:37
Customize WordPress Gallery HTML Output

#Customize WordPress Gallery HTML Output


This snippet is for modifying the shortcode and output for Wordpress's built in gallery function HTML. Particularly to modify the stucture for use with the Salvattore & Featherlight jquery to creat a masonary gallery with lightbox as none of the wordpress plugins meet my need. The source of the function is a little out of date compared with the current function Wordpress is using to output the galleries, but meets my needs as I am stripping out most of the markup. Plus I can't seem to get the shortcode_atts assigned in the function to work but thats not a deal breaker. I've updated the php with my new function. Still not sure if this is the best way to go about this but it works well for my need.

I've also added a second if statment to create another modified gallery to create a homepage slideshow using the wordpress agllery function and add suport for the Responsiveslides Jquery plugin.

I am using a conditional statment to check if the

@hlung
hlung / How to connect a PS3 controller.md
Last active March 25, 2024 14:45
How to connect PS3 controller on Mac OSX, PC

How to connect PS3 controller on Mac OSX, PC, etc.

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

@pda
pda / lircd.conf
Created January 4, 2014 05:35
LIRC config for my Apple Remote (aluminum) on Raspberry Pi / RaspBMC via one of these IR receivers: http://www.ebay.com/itm/121156693642?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Sat Dec 7 19:14:59 2013
#
# contributed by
#
# brand: lirc-pda.conf
# model no. of remote control:
@afgomez
afgomez / validate_spanish_id.js
Last active April 22, 2024 07:08
Spanish DNI, CIF, NIE validator
/**
* ValidateSpanishID. Returns the type of document and checks its validity.
*
* Usage:
* ValidateSpanishID( str );
*
* > ValidateSpanishID( '12345678Z' );
* // { type: 'dni', valid: true }
*
* > ValidateSpanishID( 'B83375575' );