Skip to content

Instantly share code, notes, and snippets.

View calvez's full-sized avatar
🏠
Working from home

calvez calvez

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
@calvez
calvez / main.css
Created July 26, 2023 11:50 — forked from elwint/main.css
Expanding Search Bar/Box CSS only (no JS)
/* Free to use for everyone */
/* Example: http://codepen.io/elwint/pen/vGMRaB */
body {
font-family: sans-serif;
background-color: #111;
}
.button {
display: inline-block;
@calvez
calvez / wp-perf.md
Created July 6, 2022 20:30 — forked from Ruzgfpegk/wp-perf.md
WordPress Performance & Development tips
@calvez
calvez / ffmpeg-to-480p.sh
Created February 27, 2022 10:03 — forked from blacklee/ffmpeg-to-480p.sh
ffmpeg convert video to 480p
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4
@calvez
calvez / m3u8-to-mp4.md
Created October 27, 2021 17:58 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@calvez
calvez / add-nav-parent-count.php
Created July 29, 2021 14:45 — forked from jessepearson/add-nav-parent-count.php
Functions to add a parent count to WordPress nav menus. This is useful if you need to change nav element size based on the number of parent/top level elements.
<?php
/**
* Gets the count of the parent items in a nav menu based upon the id specified.
*
* @param string $nav_id The id of the nav item to get the parent count for.
* @return bool|int False on fail, or the count of how many parent items there are.
* @uses wp_get_nav_menu_items
*/
function count_nav_parent_items( $nav_id = null ) {
$type = $request->input('email_or_phone');
$user = UserVerify::where('user_id', $request->input('user_id'))
->where(function($query) use ($type, $request) {
if ($type == 1) {
return $query->where('email', $request->input('email'));
}
if ($type == 2) {
return $query->where('mobile_no', $request->input('mobile_no'));
}
@calvez
calvez / mysql_backup.sh
Created November 24, 2020 20:09 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
Vue, Laravel echo + socket.io + lumen (event, listener)
Steps:
  1. Install required npm packages
    socket.io-client laravel-echo
    
  2. Registering these two package to src/main.js file
    import Echo from 'laravel-echo'
    

window.io = require('socket.io-client')

@calvez
calvez / wc-override-checkout-fields.php
Created March 14, 2019 12:37 — forked from woogists/wc-override-checkout-fields.php
[Customizing checkout fields using actions and filters] Add new shipping fields to WooCommerce
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$fields['shipping']['shipping_phone'] = array(
'label' => __('Phone', 'woocommerce'),
'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
@calvez
calvez / WP - get custom post
Created March 14, 2019 10:21 — forked from gianlucacandiotti/WP - get custom post
Get all posts for a custom post type and query them.
<?php
$type = 'custom_post_type';
$args = array(
'post_type' => $type,
'post_status' => 'publish',
'posts_per_page' => -1,
'ignore_sticky_posts'=> true
);
$my_query = null;
$my_query = new WP_Query($args);