Skip to content

Instantly share code, notes, and snippets.

@sajt
sajt / replace.sh
Created January 20, 2024 10:02
Replace mysql collation on mac OSX
sed -i '' 's/utf8mb4_0900_ai_ci/utf8_general_ci/g' dump.sql
sed -i '' 's/utf8mb4/utf8/g' dump.sql
Running bash [-c /var/folders/7x/810vnfgj4gs6t73_fzplnl_40000gn/T/test_ddev.sh]
======= Existing project config =========
These config files were loaded for project megbizasiszerzodes: [/Users/tamasamon/Projects/megbizasiszerzodes/.ddev/config.yaml]
name: megbizasiszerzodes
type: laravel
docroot: public
php_version: 7.4
webserver_type: apache-fpm
webimage: ddev/ddev-webserver:v1.22.3
additional_hostnames: []
<img src alt=“”valami> ugyanaz mint <img src={src} alt=“valami”> vagy <img src="{src}" alt=“valami”> // Ugyanaz a változó neve, mint az attribútum
<button on:click={handleClick}>
Clicked {count} {count === 1 ? 'time' : 'times'}
</button>
<script>
let count = 0;
let img = "https://i.imgflip.com/1g8my4.jpg"
$: doubled = count * 2; //reactív lesz
@sajt
sajt / TranslationTrait.php
Last active April 26, 2022 09:24
This trait extracts every field from the current model, end make an extra attribute if it is a translatable properities.
<?php
trait TranslationTrait {
public function __get($key)
{
if (collect(Schema::getColumnListing($this->getTable()))->contains($column = $key.'_'.app()->getLocale()))
{
return $this->{$column};
}
@sajt
sajt / elementor-sapi.php
Created March 14, 2021 01:06
Ezt a file-t feltöltve a Wordpress wp-content/plugins-ba és bekapcsolva, az Elementor Pro-ban form adatokat lehet küldeni a SAPI-nak. Fontos, hogy a form-ban lévő mezők id-ja megegyezzen a SAPI-ban lévő Mező nevekkel. A kódban a megfelelő változók értékeit át kell írni
<?php
/**
* Plugin Name: Elementor SAPI integration
* Plugin URI: https://webfeszek.hu
* Description: Adds a webhook for easy integration to SAPI
* Version: 0.1.0
* Author: Tamas Amon
* Author URI: https://amon.hu
* License: GPLv2 or later
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function render($request, Exception $exception)
{
if (env('APP_DEBUG')) {
@sajt
sajt / layouts.MyLayout.vue
Created January 9, 2019 12:08
Global error handling
<template>
<q-layout view="lHh Lpr lFf">
<q-layout-header>
<q-toolbar
color="primary"
:glossy="$q.theme === 'mat'"
:inverted="$q.theme === 'ios'"
>
<q-btn
flat
@sajt
sajt / index.js
Created December 16, 2017 00:07
Kérdéshe
var swisseph = require ('swisseph');
swisseph.swe_set_ephe_path (__dirname + '/ephem');
swisseph.swe_utc_to_jd(1971, 9, 25, 5, 30, 0, swisseph.SE_GREG_CAL, function(julianDay) {
ret = swisseph.swe_houses(julianDay.julianDayUT, 47.30, 19.05, 'P', function(ret) {
ret.house.forEach(function (house, index) {
console.log(strtime(house));
});
});
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global alias.visual "!gitk"