Skip to content

Instantly share code, notes, and snippets.

View jechazelle's full-sized avatar

Jérémie Chazelle jechazelle

View GitHub Profile
<?php
add_action( 'jet-engine/register-macros', function(){
class Current_Meta_User_Roles extends \Jet_Engine_Base_Macros {
public function macros_tag() {
return 'get_array_keys';
}
<?php
add_action( 'jet-engine/register-macros', function(){
//class My_JE_Macros extends \Jet_Engine_Base_Macros {
class My_JE_Macros extends \Jet_Engine_Base_Macros {
/**
* Returns macros tag
*
@jechazelle
jechazelle / config.php
Created August 16, 2023 12:28 — forked from 3mrdev/config.php
Odoo XMLRPC Example using PHP
<?php
// like import file
require_once('lib/ripcord.php');
// define variables to use in future
$url = "http://localhost:8015";
$db = "o14_api";
$username = "admin";
$password = "admin";
<?php
add_action( 'jet-engine/register-macros', function(){
class Current_Meta_Array_Keys extends \Jet_Engine_Base_Macros {
public function macros_tag() {
return 'get_array_keys';
}
@jechazelle
jechazelle / workbench.colorCustomizations.json
Created April 21, 2023 15:24 — forked from dcts/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@jechazelle
jechazelle / dropzone.js
Created March 15, 2023 17:27 — forked from worc/dropzone.js
react-dropzone formData example
// there's a sandbox to try this out on the react-dropzone website:
// https://react-dropzone.js.org/
import React from 'react';
import {useDropzone} from 'react-dropzone';
function Basic(props) {
const {acceptedFiles, getRootProps, getInputProps} = useDropzone();
const files = acceptedFiles.map(file => (
@jechazelle
jechazelle / vue.md
Created November 10, 2020 08:41 — forked from DawidMyslak/vue.md
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modyfing state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@jechazelle
jechazelle / fix-of-redis-error.md
Created January 27, 2020 19:26 — forked from hivokas/fix-of-redis-error.md
Fix of Redis error (Can't save in background: fork: Cannot allocate memory)

Errors from Laravel logs:

MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.

ERR Error running script (call to f_1af8e79ebe56ad4d7910f2e116e2555983099baf): @user_script:8: @user_script: 8: -MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.

Errors from Redis logs (/var/log/redis/redis-server.log):

* 1 changes in 900 seconds. Saving...
@jechazelle
jechazelle / free-tiles.txt
Created November 24, 2016 03:35 — forked from Yago/free-tiles.txt
GIS - Free tiles
Nokia :
http://{s}.maptile.maps.svc.ovi.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8
MapQuest :
http://a.tile.openstreetmap.org/{z}/{x}/{y}.jpg
http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg
http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg