Skip to content

Instantly share code, notes, and snippets.

View agu-z's full-sized avatar
:shipit:

Agus Zubiaga agu-z

:shipit:
View GitHub Profile
@agu-z
agu-z / setup-firebase.js
Last active November 6, 2016 06:46
Useful script that automates nativescript-plugin-firebase's setup. Add it to your `postinstall` script and enjoy 😉
let fs = require('fs');
module.exports = function() {
let fileContent = fs.readFileSync('./platforms/android/build.gradle').toString();
if (!/(classpath "com.google.gms:google-services:.*")/.test(fileContent)) {
fileContent = fileContent.replace(/(classpath "com.android.tools.build:gradle:.*")/,
'$1\n\t\tclasspath "com.google.gms:google-services:3.0.0"');
}
/*
* This rough script generates elm-ui attributes for autofill from the whatwg spec.
*
* Steps:
*
* 1) Go to https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
* 2) Open the console
* 3) Run the following code
* 4) Copy the printed string and paste it after the "on" binding in UI/TextBox/Autofill.elm
* 5) Remove the module declaration at the top
@agu-z
agu-z / bookmarklet.js
Created November 23, 2022 16:04 — forked from bramus/bookmarklet.md
Mastodon User Page Bookmarklet
javascript:(function(){
const MY_MASTO_LOCAL_DOMAIN = 'mastodon.social'; /* 👈 Change this value */
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */
function tryAndGetUserName() {
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */
const userNewProfile = document.querySelector('.moved-account-banner .button')?.getAttribute('href');
if (userNewProfile) {
return userNewProfile.substring(2);
}