This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _instanceRelateDb = null; | |
class RelateDb { | |
constructor() { | |
if (_instanceRelateDb) { return _instanceRelateDb; } | |
_instanceRelateDb = this; | |
this._db = {}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useReducer } from 'react'; | |
export const usePersistReducer = (reducer, initialState, key) => { | |
let persistKey = `__PERSIST_REDUCER_${key}__` | |
const persistReducer = (state, action) => { | |
let newState = reducer(state, action); | |
localStorage.setItem(persistKey, JSON.stringify(newState)); | |
return newState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$barbaNamespace = ''; | |
$post_type = get_post_type(); | |
switch ($post_type) { | |
case 'page': | |
$barbaNamespace = get_query_var('pagename'); | |
if ( !$barbaNamespace && $id > 0 ) { | |
// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$descFic = fopen ("/etc/passwd", "r"); | |
while ($ligne = fread ($descFic, filesize("/etc/passwd"))) | |
{ | |
echo $ligne; | |
} | |
?> |