Skip to content

Instantly share code, notes, and snippets.

View hyperframed's full-sized avatar

Hyperframed hyperframed

View GitHub Profile
@hyperframed
hyperframed / minimum-upload.php
Created July 4, 2021 15:03
Wordpress Minimum Image Dimension for Uploads
add_filter('wp_handle_upload_prefilter','tc_handle_upload_prefilter');
function tc_handle_upload_prefilter($file)
{
$img=getimagesize($file['tmp_name']);
$minimum = array('width' => '400', 'height' => '400');
$width= $img[0];
$height =$img[1];
if ($width < $minimum['width'] )
@hyperframed
hyperframed / hb_category.php
Created June 28, 2021 11:21
Hivepress check if Listing is in Category
if ( $listing->get_categories__id() ) :
foreach ( $listing->get_categories() as $category ) :
$cats = array( 91, 92, 93, 94, 95 );
$catarray = $category->get_id();
if ( in_array( $catarray, $cats ) ) :
echo "Categorie ist Suche";
else:
echo "nope!";
endif;
endforeach;
@hyperframed
hyperframed / hivepress_filter.php
Last active August 12, 2022 11:25
Hivepress Filter
add_filter(
'hivepress/v1/templates/####TEMPLATE####',
function( $template ) {
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
###############
],
],
@hyperframed
hyperframed / html.json
Last active September 19, 2022 10:08
VS Code Snippets for HTML
{
"PHP Tag": {
"prefix": "pp",
"body": [
"<?php $code ?>",
],
},
"AOS Tag": {
@hyperframed
hyperframed / javascript.json
Last active September 19, 2022 10:07
VS Code Snippets for Javascript
{
"jQuery Selector": {
"prefix": "sel",
"body": [
"$('.$Selector')",
],
},
"jQuery Selector without Class": {
@hyperframed
hyperframed / scss.json
Last active September 19, 2022 10:08
VS Code Breakpoints for SASS
{
"Break Point Min": {
"prefix": "bpmin",
"body": [
"@include bpmin($Breakpoint) {",
"\t$CSS",
"}",
],
},
@hyperframed
hyperframed / php.json
Last active September 19, 2022 10:06
VS Code Snippets for PHP
{
"PHP Tag": {
"prefix": "pp",
"body": [
"<?php $code ?>",
],
},
"AOS Tag": {
@hyperframed
hyperframed / breakpoints.scss
Last active September 19, 2022 10:05
SASS Mixin for Breakpoints
@mixin bpmax($breakpoint) {
@media all and (max-width:($breakpoint+px)) {
@content;
}
}
@mixin bpmin($breakpoint) {
@media all and (min-width:($breakpoint+px)) {
@content;
}
}
@hyperframed
hyperframed / vendorname.php
Created June 26, 2021 18:37
Get vendor name in Hivepress
echo esc_html( $listing->get_vendor__name() );
delay 1
tell application "Coda 2" to activate
tell application "System Events"
keystroke "p" using {command down, control down}
end tell