Skip to content

Instantly share code, notes, and snippets.

View mkormendy's full-sized avatar
🛠️
Building, fixing, making a living

Mike Kormendy mkormendy

🛠️
Building, fixing, making a living
View GitHub Profile
@mkormendy
mkormendy / RGBA Mixin Using SASS.markdown
Created February 11, 2016 20:45
RGBA Mixin Using SASS
@mkormendy
mkormendy / Absolute Centering Mixin with SASS.markdown
Created February 11, 2016 20:44
Absolute Centering Mixin with SASS

Absolute Centering Mixin with SASS

A simple SASS mixin to center divs using absolute positioning and 50% transform.

A Pen by Andrew Houle on CodePen.

License.

@mkormendy
mkormendy / php-cheatsheet.md
Created January 21, 2016 05:26
PHP Super Cheatsheet

##PHP Array Functions

array_diff (arr1, arr2 ...)

array_filter (arr, function)

array_flip (arr)

array_intersect (arr1, arr2 ...)

@mkormendy
mkormendy / wordpress-cheatsheet.md
Last active February 22, 2021 14:23
WordPress Cheatsheet

##Theme Structure

Template Description
header.php Header Section
index.php Main Section
sidebar.php Sidebar Section
single.php Post Template
page.php Page Template
comments.php Comment Template
@mkormendy
mkormendy / javascript_resources.md
Created January 21, 2016 04:16 — forked from randyhall/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@mkormendy
mkormendy / mysql_cheatsheet.md
Last active April 7, 2016 21:22
MySQL Cheatsheet

#MySQL Cheat Sheet

##Selecting a database: mysql> USE database;

##Listing databases: mysql> SHOW DATABASES;

##Listing tables in a db: mysql> SHOW TABLES;

@mkormendy
mkormendy / self-this.php
Created January 21, 2016 04:07
When to use self over $this
<?php
class Person {
private $name;
public function __construct($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
@mkormendy
mkormendy / plugin-template(shortcodes).php
Last active January 21, 2016 05:30
Site-Specific WordPress Plugin Template (shortcodes)
<?php
/*
Plugin Name: Template Site Plugin for example.com
Description: Site specific plugin template for example.com, in this case we are creating a widget
*/
////////////////////////////////////////////
// Start Adding Functions Below this Line //
////////////////////////////////////////////
/* self-closing shortcode */
@mkormendy
mkormendy / plugin-template(widget).php
Last active January 21, 2016 05:30
Site-Specific WordPress Plugin Template (widgets)
<?php
/*
Plugin Name: Template Site Plugin for example.com
Description: Site specific plugin template for example.com, in this case we are creating a widget
*/
////////////////////////////////////////////
// Start Adding Functions Below this Line //
////////////////////////////////////////////
// Create a widget
@mkormendy
mkormendy / loop.php
Created January 20, 2016 16:05
Loop Example
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Test if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
<!-- Otherwise, the div box is given the CSS class "post". -->
<?php if ( in_category( '3' ) ) : ?>
<div class="post-cat-three">
<?php else : ?>