Skip to content

Instantly share code, notes, and snippets.

@llemurya
llemurya / wordpress_dashicons_array.php
Last active January 27, 2023 11:44
WordPress dashicons array
<?php
$dashicons = array(
'dashicons-menu',
'dashicons-dashboard',
'dashicons-admin-site',
'dashicons-admin-media',
'dashicons-admin-page',
'dashicons-admin-comments',
'dashicons-admin-appearance',
'dashicons-admin-plugins',
@llemurya
llemurya / wordpress_genericons.php
Created March 18, 2016 12:16
WordPress genericons
<?php
$genericicons = array(
'genericon-standard',
'genericon-aside',
'genericon-image',
'genericon-gallery',
'genericon-video',
'genericon-status',
'genericon-quote',
'genericon-link',
@llemurya
llemurya / font-awesome-parser.js
Last active January 17, 2017 10:58
font-awesome parse icons and group by categories
(function(){
var sections = jQuery('#icons').children();
var collector = [];
sections.each(function(){
var that = jQuery(this);
if(that.attr('id') !== 'new'){
jQuery(this).find('i').filter(function(){ return !jQuery(this).siblings('.text-muted').length }).each(function(){
@llemurya
llemurya / parse-dashicons.js
Created January 17, 2017 11:03
parse dashicons and group by categories.
(function(){
var children = jQuery('#iconlist').children();
console.log(children);
var category = '';
var collector = [];
children.each(function(){
if (jQuery(this).is('h4')) {
console.log('is h4');
category = jQuery(this).text().toLowerCase().replace(' ', '-');
console.log(category);
License Key PhpStorm 8
User Name : EMBRACE
===== LICENSE BEGIN =====
43136-12042010
00002UsvSON704l"dILe1PVx3y4"B3
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh
gd1BebYc5U"6OxDbVsALB4Eb10PW8"
===== LICENSE END =====
<?php
/**
* @see http://stackoverflow.com/questions/40836144/php-how-to-get-images-from-instagram-without-api-access-token
* You can use function file_get_conents instead wp_remote_get
*/
function get_instagram_images( $username, $limit = 100 ){
$profile_url = "https://www.instagram.com/$username/?__a=1";
$iteration_url = $profile_url;
@llemurya
llemurya / expect-header-fix.php
Created March 10, 2021 22:31 — forked from carlalexander/expect-header-fix.php
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = !empty($arguments['body']) && strlen($arguments['body']) > 1048576 ? '100-Continue' : '';