Skip to content

Instantly share code, notes, and snippets.

View siamkreative's full-sized avatar

Julien Vernet siamkreative

View GitHub Profile
@siamkreative
siamkreative / ga-snippet.html
Created January 30, 2017 02:36
Google Analytics sample code snippet
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
```php
<?php
// Specific style for iPhone
if( $detect->isiOS() && !$detect->isTablet() ) {
// This fixes position of the bottom bar on iOS 12.4 and above
echo "<style type='text/css'>#nm5viewBtmHolder { position: fixed; bottom: 0; width: 100%; }</style>";
}
?>
@siamkreative
siamkreative / building-cordova-apps-fedora-31-draft.md
Created January 31, 2020 04:38
Building Cordova apps on Fedora 31

Installing and configuring Docker

Install Docker

sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf makecache
sudo dnf install docker-ce

Install Docker-Compose

@siamkreative
siamkreative / fedora-31-install-webstorm.md
Created February 14, 2020 04:21
Installing WebStorm on Fedora 31
@siamkreative
siamkreative / ruby-mac-m1.md
Last active November 2, 2022 08:31
Quick guide on how to install Ruby on a MacBook M1

Install Ruby on a MacBook Air M1

Prerequisites

  • You already have brew installed (you can double check that everything is setup with brew doctor).
  • Make sure you don’t have RVM, rbenv, or asdf installed (read this)

Installation Steps

  1. Run ruby-install 3.1.2 -- --enable-shared (taken from this article)
@siamkreative
siamkreative / disable-bloatware-xiaomi-phones.md
Last active February 18, 2024 11:07
Disabling bloatware on Xiaomi phones

How to disable or uninstall bloatwares on Xiaomi?

This guide is for non-rooted Xiaomi/Redmi/POCO phones.

  1. You will first need to install Android Debug Bridge (ADB): https://developer.android.com/tools/adb. On a Mac, you can install it with Brew: brew install android-platform-tools
  2. To use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options. On a Xiaomi phone, tap the MIUI version multiple times until Developer Options are unlocked. You can then search the Settings for "USB debugging" and enable it.
  3. Connect the phone to your computer via USB. Choose “File Transfer” mode.
  4. Open a terminal and run adb devices
  5. Your phone will prompt to add your computer’s key to allowed, whihc you must agree to.
  6. On the terminal, enter adb shell.