Skip to content

Instantly share code, notes, and snippets.

View PaGury's full-sized avatar
🤡
Ordinateur

PaGury PaGury

🤡
Ordinateur
  • usedrop.io
  • Nantes, France
  • X @pagury
View GitHub Profile
type FormValues = {
email: string;
password: string;
passwordMatch: string;
};
export const Signup = () => {
const tAuth = useTranslations('auth');
const tForm = useTranslations('tranverse');
@PaGury
PaGury / proxify.js
Last active October 13, 2020 13:08
Used to proxify any object and listen any get or set commands on it. Also it's possible to suppress the getter and setter logs, or whitelisting only some keys.
function proxify(obj, { name, keys, showGet = true, showSet /* lol */ = true }) {
return new Proxy(obj, {
get: function (target, key, receiver) {
if (((keys.length > 0 && keys.includes(key)) || keys.length === 0) && showGet) {
console.group('Proxify', name, 'GET', key);
console.trace('Proxify', name, 'TRACING');
console.dir({
target,
key,
var funcSerialized = (name) => `function ${name}() { [native code] }`;
var nativeObjects = [Array, Boolean, Date, Function, JSON, Object, Promise, RegExp];
var ignoreList = ['length', 'constructor', '__proto__', 'caller', 'callee', 'arguments', 'source', 'toGMTString'];
var test = (nativeObject) => {
const proto = nativeObject.prototype || nativeObject;
Object.getOwnPropertyNames(proto)
.filter(name => !ignoreList.includes(name))
.filter(name => proto[name])
.map(name => ({
name,

Keybase proof

I hereby claim:

  • I am pagury on github.
  • I am pagury (https://keybase.io/pagury) on keybase.
  • I have a public key ASDN6vZue4lvKOFVUgRUICmYszzOfhNqoNGpTsLzxsMUsgo

To claim this, I am signing this object: