Skip to content

Instantly share code, notes, and snippets.

View hiiightower's full-sized avatar
🦇
ilybu

andy ryan hightower hiiightower

🦇
ilybu
View GitHub Profile
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@jimakker
jimakker / json-feed.php
Created August 22, 2012 01:02
Add custom fields capability to JSON-feed Wordpress plugin
<?php
/*
Plugin Name: JSON feed
Plugin URI: http://wordpress.org/extend/plugins/json-feed/
Description: Provides feeds in JSON form
Version: 1.3
Author: Chris Northwood (modified by Dan Phiffer)
Author URI: http://www.pling.org.uk/
Contributors: @jimakker
Comments: works on WP 3.4.1
@bugsysop
bugsysop / timeline.php
Created September 27, 2012 20:53
Verite Timeline JSON controller for JSON API WordPress Plugin
<?php
/*
JSON Controller for JSON API WordPress Plugin to return posts in Timeline format for Verite Timeline WordPress Plugin
Author: Miguel Peixe
Reference: http://wordpress.org/support/topic/plugin-verite-timeline-getting-wordpress-posts-into-timeline
@andregomes
andregomes / ajax.php
Created March 25, 2013 23:00
PHP: Parse JSON
<?php
$json ='{"id":1,"name":"foo","interest":["wordpress","php"]} ';
$obj=json_decode($json);
echo $obj->interest[1]; //prints php
?>
@mattbeck
mattbeck / gist:e4cd732bbf94ff2c865f
Last active January 30, 2018 07:13
Sample WordPress Data Import Plugin
<?php
/**
* Plugin Name: Run-Once Data Importer
* Description: This plugin will add custom field data to a predefined set of posts
* Version: 1.0
* Author: mattbeck
*/
register_activation_hook( __FILE__, 'runonce_data_import' );
@kepek
kepek / _bem.scss
Created January 8, 2015 22:46
BEM Mixin (Block Element Modifier) for SCSS/SASS
/*
* BEM Mixin
*
* Block / Element / Modifier
*
* Example:
*
* @include b(test) {
* background: red;
* @include m(modifier) {
@siamak
siamak / BEM__Mixin.scss
Last active May 17, 2021 14:10
Mixin of BEM selectors with SCSS
/*
_____ _ _ ___ ___ _ _ _ _
/ ___|(_) | | | \/ | | | | | | | (_)
\ `--. _ __ _ _ __ ___ __ _ | | __ | . . | ___ | | __| |__ | |_ __ _ _ __ _
`--. \| | / _` || '_ ` _ \ / _` || |/ / | |\/| | / _ \ | |/ /| '_ \ | __|/ _` || '__|| |
/\__/ /| || (_| || | | | | || (_| || < | | | || (_) || < | | | || |_| (_| || | | |
\____/ |_| \__,_||_| |_| |_| \__,_||_|\_\ \_| |_/ \___/ |_|\_\|_| |_| \__|\__,_||_| |_|
www.siamak.us
== Mixin of BEM selectors with SCSS: ==
@SudoPlz
SudoPlz / commentRemover.js
Last active December 15, 2023 07:08
A messy little js file that removes comments from any string passed into `stripComments(str)` function.
exports.stripComments = function stripComments(toBeStrippedStr){
//LEXER
function Lexer () {
this.setIndex = false;
this.useNew = false;
for (var i = 0; i < arguments.length; ++i) {
var arg = arguments [i];
if (arg === Lexer.USE_NEW) {
this.useNew = true;
}
@xolf
xolf / status.php
Last active January 30, 2018 07:26
xolf - Json list
<?php
$list = file_get_contents('https://gist.githubusercontent.com/xolf/84ff46881bae03741b57/raw/bfe1bda4c24024a571c697abedcfb03ef3f5feb3/xolf.json');
$list = json_decode($list);
var_dump($list);
foreach ($list->pages as $page) {
$start = microtime(true);
@mbarnard
mbarnard / element-modifier-class.scss
Created August 6, 2016 15:52
@Mixins to create BEM element & modifier classes
/*------------------------------------*\
* #element-modifier-class
* BEM element & modifier classes
* Using @at-root provides nesting declarations in Sass,
* but compiles them to the stylesheet’s root.
\*------------------------------------*/
/**
* @mixin element
* Create a child element declaration