Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
Looking for work

Scott Alexander-Bown scottyab

👀
Looking for work
View GitHub Profile
@scottyab
scottyab / firebase-hosting-deploy.yml
Last active Jan 4, 2023
Github action used on Scottyab.com to Build Jekyll and Deploy to Firebase Hosting when commits pushed to main. `GITHUB_TOKEN`, `FIREBASE_PROJECT_ID`, `FIREBASE_SERVICE_ACCOUNT` will vary for your setup and need to be configured via Githuib repo settings..
View firebase-hosting-deploy.yml
name: Build and Deploy to Firebase
'on':
push:
branches:
- main
jobs:
build_and_deploy:
name: Build and deploy Jekyll site
runs-on: ubuntu-latest
@scottyab
scottyab / MyAppFirebaseMessagingService.kt
Last active Aug 17, 2020
Sample of how an app "MyApp" would intergrate and enable Beacon SDK push notifications
View MyAppFirebaseMessagingService.kt
class MyAppFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if(remoteMessage.data.isNotEmpty()) {
processNewMessage(remoteMessage.data)
}
}
private fun processNewMessage(remoteMessageData: Map<String, String>) {
if (BeaconPushNotificationsProcessor.isBeaconNotification(remoteMessageData)) {
@scottyab
scottyab / SampleEncPrefs.kt
Created Jul 24, 2019
Simple example of using EncrypredSharedPreferences
View SampleEncPrefs.kt
package com.scottyab.whatsnewplayground.data
import android.content.Context
import android.content.SharedPreferences
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKeys
import com.scottyab.whatsnewplayground.BuildConfig
internal class SampleEncPrefs(context: Context) {
@scottyab
scottyab / Coloring.java
Created Oct 29, 2018 — forked from milosmns/Coloring.java
Android: Coloring (Helper Class)
View Coloring.java
package me.angrybyte.coloringdemo;
import static android.graphics.PorterDuff.Mode.SRC_ATOP;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
View convertSvgToPng.sh
#!/usr/bin/env bash
# exit if fails
set -o errexit
set -o pipefail
# reads the first arg as the file - expected list of file names without extension
filename="${1:-}"
# loops through each line
while read -r line
@scottyab
scottyab / add-copyright.py
Last active May 24, 2018 — forked from rodrigosetti/add-copyright.py
Adds Copyright Notice to a bunch of Java and Kotlin files
View add-copyright.py
@scottyab
scottyab / Contract Killer 3.md
Created Nov 24, 2017 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

View PageLinks.java
View WeeklyDayCalorieBarView.java
package com.enquos.nutrition.dashboard;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
View QLog.java
package com.bizzby.utils;
import android.util.Log;
import java.io.PrintWriter;
import java.io.StringWriter;
public class QLog
{