View SearchComponent.js
This file contains 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 {Avatar, Input, Popover} from 'antd'; | |
import React, {useState} from 'react'; | |
import Fuse from 'fuse.js'; | |
import {useGlobal} from 'reactn'; | |
const {Search} = Input; | |
export default function SearchComponent() { | |
const [gPosts] = useGlobal('gPosts'); |
View AvatarEditor.js
This file contains 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 React, {useState} from 'react'; | |
import dynamic from 'next/dynamic'; | |
import {message, Modal} from 'antd'; | |
import {auth, db, storage} from '../../../firebase/clientApp'; | |
import isEmpty from 'lodash/isEmpty'; | |
const Avatar = dynamic(() => import('react-avatar-edit'), {ssr: false}); | |
function AvatarEditor({show, setShow, user}) { | |
const [data, setData] = useState(null); |
View CFAuthProvider.js
This file contains 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 React, {createContext, useEffect, useState} from 'react'; | |
import {useGlobal} from 'reactn'; | |
import {useAuthState} from 'react-firebase-hooks/auth'; | |
import {useDocument} from 'react-firebase-hooks/firestore'; | |
const CFAuthContext = createContext({}); | |
const useUser = ({auth, firestore}) => { | |
const [gUser, setGUser] = useGlobal('user'); | |
const [user, loading, error] = useAuthState(auth); |
View reduce.js
This file contains 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
// Production steps of ECMA-262, Edition 5, 15.4.4.21 | |
// Reference: http://es5.github.io/#x15.4.4.21 | |
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce | |
if (!Array.prototype.reduce) { | |
Object.defineProperty(Array.prototype, 'reduce', { | |
value: function(callback /*, initialValue*/) { | |
if (this === null) { | |
throw new TypeError( 'Array.prototype.reduce ' + | |
'called on null or undefined' ); | |
} |
View forEach.js
This file contains 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
// Production steps of ECMA-262, Edition 5, 15.4.4.18 | |
// Reference: http://es5.github.io/#x15.4.4.18 | |
if (!Array.prototype.forEach) { | |
Array.prototype.forEach = function(callback/*, thisArg*/) { | |
var T, k; | |
if (this == null) { | |
throw new TypeError('this is null or not defined'); |
View dbLog.php
This file contains 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 | |
if (!function_exists('dbStartLog')) { | |
function dbStartLog() | |
{ | |
app('db')->enableQueryLog(); | |
} | |
} | |
if (!function_exists('dbEndLog')) { | |
function dbEndLog(Closure $closure = null) | |
{ |
View saveBlob.php
This file contains 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 | |
if (!function_exists('saveBlob')) { | |
function saveBlob($blobdata = 'blobdata', $dir = 'blobdata') | |
{ | |
//$blobdata head : data:image/jpeg;base64, | |
$blobdata = request($blobdata); | |
list($type, $blobdata) = explode(';', $blobdata); | |
list(, $blobdata) = explode(',', $blobdata); | |
$blobdata = base64_decode($blobdata); |