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 / wpbck.sh
Created February 3, 2022 13:05
wp backup gzip and move with timestamp
# will be: .backup/2022-02-03-14:04:00.sql.gz
wp db export - | gzip > .backup/$(date +%F-%T).sql.gz
@calvez
calvez / form-component.php
Last active December 10, 2021 11:36
livewire example of emit throw errors
<?php
/**
*
* Save domain or wildcard
* regex from this crazy:
* wildcard: *.wilddomain.hu
* https://www.regextester.com/102477
*
* validator:
* https://laravel-livewire.com/docs/2.x/input-validation
@calvez
calvez / post_types.php
Last active November 30, 2021 10:49
WP_Query on diff post_types with custom conditions
<?php
/**
* Event layout
*/
get_header();
$description = get_the_archive_description();
?>
@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
// Base EA template
// More templates and snippets on https://github.com/sibvic/mq4-templates
// You need:
// 1. To implement LongCondition, ShortCondition, ExitLongCondition and ExitShortCondition
// 2. To replace all includes with code from the snippets folder. You can use https://github.com/sibvic/MQ4Inject for that.
#property version "1.0"
#property description "Developed by Victor Tereschenko: sibvic@gmail.com"
#property strict
@calvez
calvez / 7trade-clvz.set
Created April 30, 2020 19:23
7 trade ea
#
# https://www.myfxbook.com/portfolio/mt4-20981445/5650958
#
Languale=1
StopLossProcent=0.0
UseLotManual=false
ManualLot=0.01
Risk=5.0
PipsStep=6.0
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')