Skip to content

Instantly share code, notes, and snippets.

@shrimp2t
shrimp2t / get-instagram-images-without-api.php
Last active Jun 24, 2020
Get instagram images without API
View get-instagram-images-without-api.php
<?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;
View get-hook-info.php
<?php
/*
Plugin Name: Get hook info
Plugin URI: https://github.com/shrimp2t/Lib/blob/master/get-hook-info.php
Description: Show hook info at the bottom of source code.
Author: Matt Shrimp2t
Version: 1.6
Author URI: https://github.com/shrimp2t
*/
/**
@shrimp2t
shrimp2t / wp-auto-save-image-from-content.php
Created Jun 17, 2017
WP auto save images from content
View wp-auto-save-image-from-content.php
<?php
class Auto_Save_Images{
function __construct(){
add_filter( 'content_save_pre',array($this,'post_save_images') );
}
function post_save_images( $content ){
View get-all-images-from-content.php
<?php
function get_link_img_post( $content ){
global $post;
preg_match_all('/src="(.*)"/Us',$content,$matches);
$link_img_post = $matches[1];
return $link_img_post;
}
View add-params-url.js
var addParams = function( url, data )
{
if ( ! $.isEmptyObject(data) )
{
url += ( url.indexOf('?') >= 0 ? '&' : '?' ) + $.param(data);
}
return url;
};
@shrimp2t
shrimp2t / available_font-awesome_icons.php
Created Jul 1, 2017 — forked from gubi/available_font-awesome_icons.php
Get all icons from a font-awesome.css file and list in json mode
View available_font-awesome_icons.php
<?php
/**
* Available Font Awesome icons
*
* Get all icons from a font-awesome.css file and list in json mode
*
* @author Alessandro Gubitosi <gubi.ale@iod.io>
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3
*/
View Enable-Auto-store-thumbnail.php
<?php /*
Plugin Name: Enable Auto store thumbnail
Version: 1.0.0
*/
$stores = get_terms( array(
'taxonomy' => 'coupon_store',
'hide_empty' => false,
) );
foreach ( $stores as $t ) {
@shrimp2t
shrimp2t / get-font-awesome-icon-classes.php
Created Aug 14, 2017
Get font-awesome icons from css file
View get-font-awesome-icon-classes.php
<?php
**
* Remove items from an array
* @param array $array The array to manage
* @param void $element An array or a string of the item to remove
* @return array The cleaned array with resetted keys
*/
function array_delete($array, $element) {
return (is_array($element)) ? array_values(array_diff($array, $element)) : array_values(array_diff($array, array($element)));
View GridJS.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Algorithm </title>
<script type="text/javascript">
// http://underscorejs.org/underscore-min.js
var flag = [], backupFlag = [];
@shrimp2t
shrimp2t / pe-customize-controls.css
Created Feb 26, 2018 — forked from OriginalEXE/pe-customize-controls.css
Extending WordPress Customizer Panels and Sections to allow nesting
View pe-customize-controls.css
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}