Skip to content

Instantly share code, notes, and snippets.

View warengonzaga's full-sized avatar

Waren Gonzaga warengonzaga

View GitHub Profile
@warengonzaga
warengonzaga / README.md
Created September 27, 2023 17:01
Recover Ownership of Contract (thirdweb)

Recover Ownership of Contract

This is useful when your admin for your contract has been compromised. For example, when you add balance to your admin address and suddenly your admin balance goes to random address. It is painful to remove your admin address if you don't have a gas to spend to assign a new admin address.

Setup

  1. Do npx thirdweb create app --node --javascript --evm
  2. Rename the .env.example to .env
  3. Copy and paste this to your .env
@warengonzaga
warengonzaga / electronic_ultrasonic_emitter_basic.ino
Last active January 20, 2024 18:37
Electronic Ultrasonic Emitter (Project E.U.E) - Basic Version
/**
* Electronic Ultrasonic Emitter (Project E.U.E) - Basic Version
* by Waren Gonzaga
* Version: 1.0.6
*
* A simple project that emits ultrasonic waves and possible to repel mosquiotoes.
* Check this project on Instructables.com
* Link: https://www.instructables.com/id/Electronic-Ultrasonic-Emitter-Basic-Version/
*
* Contribute to improve this project on gist!
@warengonzaga
warengonzaga / build_your_own_react.md
Last active September 20, 2023 03:12
React - Plain Javascript

Build Your Own React

Here's the code on how you can build your own react. So you can understand how react works.

@warengonzaga
warengonzaga / git-update-remote-branch-list.md
Created August 29, 2022 08:40
Git - Update Remote Branch List

Update Remote Branch List - Git Commands

  1. Update your remote branch list.
git remote update origin --prune
  1. After that, check your remote branch list.
git branch -a
@warengonzaga
warengonzaga / profiles.yml
Last active April 16, 2022 08:43
Minecraft Configs - FarmControl
# Please visit https://github.com/froobynooby/FarmControl/wiki/Profiles for help with making profiles.
profiles:
###########################################################
# PROACTIVE MODE
###########################################################
# ======================================================= #
# nerf animal farms
@warengonzaga
warengonzaga / git-new-empty-branch.md
Last active March 15, 2022 13:25
Git - New Empty Branch

New Empty Branch - Git Commands

  1. Switch to a new empty branch.
git switch --orphan <branch-name>
  1. Remove all the files, mostly all in the .gitignore file will start to show here.
rm -rf *
@warengonzaga
warengonzaga / logout-without-confirmation.php
Created November 25, 2021 15:10
WP Snippet - Logout Without Confirmation
<?php
// logout without confirmation
function logout_without_confirmation($action, $result) {
if ($action == "log-out" && !isset($_GET['_wpnonce'])) {
$redirect_to = isset($_REQUEST['redirect_to'])?$_REQUEST['redirect_to']:'';
$location = str_replace('&amp;', '&', wp_logout_url($redirect_to));
header("Location: $location");
die;
}
@warengonzaga
warengonzaga / keybase.md
Created May 30, 2021 13:19
Keybase Proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@warengonzaga
warengonzaga / functions.php
Created January 10, 2020 15:02
Defer JavaScript via functions.php File
function defer_parsing_of_js( $url ) {
if ( is_user_logged_in() ) return $url; //don't break WP Admin
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );
@warengonzaga
warengonzaga / warens_led_music_visualizer.ino
Last active April 2, 2019 20:19
Waren's L.E.D Music Visualizer (The Project W.L.E.D.M.V)
/**
* Waren's LED Music Visualizer (Project W.L.E.D.M.V)
* by Waren Gonzaga
* Version: 1.0.1
*
* An Arduino project that translates the sound into lights.
* Check this project on Instructables.com
* Link: https://www.instructables.com/id/Warens-LED-Music-Visualizer
*
* Contribute to improve this project on gist!