Skip to content

Instantly share code, notes, and snippets.

View marczhermo's full-sized avatar

Marco Hermo marczhermo

  • New Zealand
View GitHub Profile
@marczhermo
marczhermo / grecaptcha.css
Created September 8, 2021 06:44
Recaptcha V3 Move to Left Side
.grecaptcha-badge {
width: 70px !important;
overflow: hidden !important;
transition: all 0.3s ease !important;
left: -2px !important;
bottom: 20px !important;
}
.grecaptcha-badge:hover {
width: 256px !important;
@marczhermo
marczhermo / getter_setter.js
Created August 8, 2021 11:09
Getter and Setter JS
const self = {
title: 'New Zealand',
hello() {
this.world();
},
world() {
console.log(`World: ${this.title}`);
},
};
@marczhermo
marczhermo / mysql_reset.sql
Created May 2, 2021 12:33
Reset Root Password
use mysql;
update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
#!/bin/sh
# Example command
# ./standardswatch.sh app/tests/Jobs/CityCountryImportJobTest.php
while inotifywait -e modify $1
do
clear && composer silverstripe-standards
done
@marczhermo
marczhermo / watch_phpunit.sh
Created April 28, 2021 10:11
Watcher using inotifywait for running phpunit
#!/bin/sh
# Example command
# ./phpunitwatch.sh app/tests/Jobs/CityCountryImportJobTest.php
# ./phpunitwatch.sh app/tests/Jobs/CityCountryImportJobTest.php --coverage-text
while inotifywait -e modify $1
do
clear && vendor/bin/phpunit $1 $2
done
@marczhermo
marczhermo / Most commands used.sh
Created November 19, 2019 02:38
Most commands used in reverse order
history | awk '{print $2}' | sort | uniq -c | sort -rn
@marczhermo
marczhermo / console.log.js
Created May 20, 2018 16:25
console.log.js
console.log(`%c vue-devtools %c Detected Vue 3 %c`,"background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff","background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff","background:transparent")
@marczhermo
marczhermo / query.json
Created May 2, 2018 14:59
ElasticSearch
GET _search
"query": {
"match": {
"name": {
"query": "Vacuummm",
"fuzziness": 2,
"prefix_length": 1
}
}
}
@marczhermo
marczhermo / observeDOM.js
Created May 2, 2018 14:57
Dom Mutation Observer
var cart = $('#gadget-cart');
var observeDOM = (function(){
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
eventListenerSupported = window.addEventListener;
return function(obj, callback){
if( MutationObserver ){
// define a new observer
var obs = new MutationObserver(function(mutations, observer){
@marczhermo
marczhermo / update_curl.sh
Created July 10, 2017 10:05 — forked from fideloper/update_curl.sh
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2