Skip to content

Instantly share code, notes, and snippets.

@shrimp2t
shrimp2t / get-instagram-images-without-api.php
Last active October 19, 2022 14:24
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;
@shrimp2t
shrimp2t / get-hook-info.php
Created May 31, 2017 03:20
Get hook info
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 June 17, 2017 04:23
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 ){
@shrimp2t
shrimp2t / get-all-images-from-content.php
Created June 17, 2017 04:25
Get all images from 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;
}
@shrimp2t
shrimp2t / add-params-url.js
Created June 23, 2017 00:26
Add params to URL
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 July 1, 2017 01:17 — 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
*/
@shrimp2t
shrimp2t / Enable-Auto-store-thumbnail.php
Created July 4, 2017 09:39
Enable Auto store thumbnail
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 August 14, 2017 02:37
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)));
@shrimp2t
shrimp2t / GridJS.html
Created December 12, 2017 09:46
Grid columns
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 February 26, 2018 09:26 — 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%);
}