Skip to content

Instantly share code, notes, and snippets.

@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@hermpheus
hermpheus / GetWP
Created July 5, 2012 20:33 — forked from scottlee/GetWP
Ubuntu LAMP: Create WordPress install, apache, hosts, etc
#!/bin/bash
##########
## Setup: hardcode your mysql user/pass. Yeah, yeah, I know...it's frowned upon.
## but for local development, I have no problem with it.
## Find and replace: MYSQLUSER / MYSQLPASS
##
## Usage: This script accepts only one variable, the site name.
##
#########
@SamFleming
SamFleming / grooveshark_fluid.js
Created July 9, 2012 16:50
Grooveshark for Fluid
// ==UserScript==
// @name Grooveshark for Fluid
// @namespace clintxs@gmail.com
// @description Adds Growl notifications and iTunes-style track info to the dock menu. Also adds the controls: Play/Pause, Next, and Previous.
// @include http://*grooveshark.com/*
// @author Clint Strong
// ==/UserScript==
(function () {
if (window.fluid) {
@BaylorRae
BaylorRae / doc_block.php
Created July 17, 2012 20:38
Parse PHP Doc Blocks
<?php
class DocBlock {
public $docblock,
$description = null,
$all_params = array();
/**
* Parses a docblock;
@johnpbloch
johnpbloch / media-wut.js
Created December 18, 2012 17:01
Add a custom page to the new media manager in WordPress that only shows attachments uploaded to this post with no controls to change it. This is undoubtedly bad programming, but that javascript is a huge mess of undocumented code with little to no help in figuring out how to extend it.
(function($){
var media = wp.media,
jeditor = {
oldMainMenu : media.view.MediaFrame.Post.prototype.mainMenu,
init : function(){
media.view.MediaFrame.Post.prototype.mainMenu = function(view){
jeditor.oldMainMenu(view);
var jState = new media.controller.Library({
id: 'test',
library: media.query({uploadedTo: media.view.settings.post.id}),
@vimishor
vimishor / date.php
Created December 18, 2012 22:17
The clean and fast way for changing date format in PHP
<?php
$date = new DateTime('now');
echo $date->format('d/m/Y').PHP_EOL; // format: day/month/year
echo $date->format('m-d-Y').PHP_EOL; // format: month-day-year
echo $date->format('Y-m-d').PHP_EOL; // format: year-month-day
// add 3 days to current date and output using format year-day-month
echo $date->setTimestamp( strtotime('+3 days', $date->getTimestamp()) )->format('Y-d-m');
define( 'CHILD_THEME_VERSION', filemtime( get_stylesheet_directory() . '/style.css' ) );
@StefanoRausch
StefanoRausch / include-once.scss
Created September 28, 2013 17:51
Import Once Feature Implemented in Sass.
$is-included : () !default;
@mixin once( $name ) {
@if include-once( $name ) {
@content;
}
}
@function include-once( $name ) {
@if index( $is-included, $name ) {

Sass/CSS-Crush Comparison

This is an adaptation of the Sass/Less comparison document.

Not a comprehensive overview of features of either library but a comparison of commonalities.

Variables

Sass | Crush