Skip to content

Instantly share code, notes, and snippets.

@Smurph82
Smurph82 / mysql-docker.sh
Created October 20, 2021 23:56 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@Smurph82
Smurph82 / avd_opener.ps1
Last active December 4, 2019 19:21
Have you ever wanted to start an Android emulator without opening Android Studio. Well this might help. It is a powershell script that once setup can open any of your AVDs. You need to change the path to your location of the emulator.exe. It should be found in the Android SDK directory, under the Emulator directory.
C:\Users\userName\AppData\Local\Android\Sdk\emulator\emulator.exe -list-avds
$avd = Read-Host -Prompt "Enter avd name."
C:\Users\userName\AppData\Local\Android\Sdk\emulator\emulator.exe -avd "$avd"
@Smurph82
Smurph82 / yubitouch.sh
Created November 26, 2017 03:04 — forked from a-dma/yubitouch.sh
Bash script for setting or clearing touch requirements for cryptographic operations in the OpenPGP application on a YubiKey 4.
#!/bin/bash
# Bash script for setting or clearing touch requirements for
# cryptographic operations the OpenPGP application on a YubiKey 4.
#
# Author: Alessio Di Mauro <[email protected]>
GCA=$(which gpg-connect-agent)
DO=0
UIF=0
@Smurph82
Smurph82 / code.kt
Created November 24, 2017 04:06 — forked from chrisbanes/code.kt
Night Mode inflater
/*
* Copyright 2017 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Smurph82
Smurph82 / Java8DateTimeExamples.java
Created November 22, 2017 19:41 — forked from mscharhag/Java8DateTimeExamples.java
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {

Keybase proof

I hereby claim:

  • I am smurph82 on github.
  • I am smurph82 (https://keybase.io/smurph82) on keybase.
  • I have a public key ASDFy_TSn3xg-f3vNoS6WTIkR7UwhuBGPRky8KriZfrKqwo

To claim this, I am signing this object:

@Smurph82
Smurph82 / FloatingBtnAnimaControl.java
Last active May 15, 2016 13:13
Animate Floating Action Button Android L. This will give your floating action button an animation similar to the Android Google+ app when scrolling on a RecyclerView.
/**
* Copyright (c) 2014 Ben Murphy (Smurph82)
* Created - Aug 19, 2014
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*