Skip to content

Instantly share code, notes, and snippets.

@himattm
himattm / convert_mp4_to_mp3.sh
Created March 7, 2022 19:06
Uses ffmpeg to convert mp4 to mp3 and also truncate silences
#!/bin/bash
for i in *.mp4
do
#ffmpeg -i "$i" "${i%mp4}mp3" # Convert mp4 to mp3
ffmpeg -i "$i" -af silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-55dB "removed_silence_${i%mp4}mp3"
done
@himattm
himattm / md_image_link_example.md
Last active December 21, 2021 21:17
How to make a clickable image in Markdown
@himattm
himattm / Issue_24_Practice_Question.kt
Last active October 13, 2021 13:59
Today we have a Kotlin brain teaser! What does this code print?
data class Foo(val i: Int)
fun main() {
val map = mapOf(
1 to Foo(1),
2 to Foo(2),
3 to Foo(3),
)
println("map = $map")
@himattm
himattm / St_Answer_Issue_16.kt
Created August 5, 2021 13:41
The answer to the practice question asked in StoicallyTyped Issue 15 and answered in 16
data class Event(val title: String, val day: String)
fun main() {
// Create a list of our events
val events = listOf<Event>(
Event("New StoicallyTyped Newsletter", "Monday"),
Event("Workout", "Monday"),
Event("Conference", "Tuesday"),
Event("@AdamMc331 Streams", "Wednesday"),
Event("Car Wash", "Thursday"),
@himattm
himattm / build.gradle.kts
Created July 14, 2021 13:44
Fix Jetpack Compose @Preview in release candidate 01
configurations.all {
resolutionStrategy {
force("androidx.compose.ui:ui-tooling:1.0.0-beta09")
force("androidx.compose.ui:ui-tooling-data:1.0.0-beta09")
force("androidx.compose.ui:ui-tooling-preview:1.0.0-beta09")
}
}
@himattm
himattm / keybase.md
Last active February 16, 2017 22:56

Keybase proof

I hereby claim:

  • I am matthewcmckenna on github.
  • I am mattmck (https://keybase.io/mattmck) on keybase.
  • I have a public key ASBSUPeXRxGTrcK8V61EIuOniQLOwUghjngM4SEGLYOKjQo

To claim this, I am signing this object:

@himattm
himattm / cast_ic_notification_small_icon.xml
Last active October 20, 2016 15:56
How to change Chromecast SDK v3 Notification Icon: Use this file in your /drawable folder
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_your_notification_icon" />
<!-- Default Cast v3 notification icon -->
<!-- android:src="@drawable/quantum_ic_cast_connected_white_24" -->
@himattm
himattm / build.gradle
Created October 6, 2016 18:57
split apk exception fix
splits {
abi {
enable true
reset()
include 'armeabi', 'x86'
universalApk false
}
}
@himattm
himattm / bash_profile
Created August 18, 2016 17:22
Mac .bash_profile
# -------
# Aliases
# -------
alias ll="ls -al"
alias la="ls -a"
alias ldir="ls -al | grep ^d"
alias ip="curl icanhazip.com"
@himattm
himattm / hide-desktop-icons
Created April 28, 2016 02:27
Hide's the desktop icons on Ubuntu using 'gsettings'
gsettings set org.gnome.desktop.background show-desktop-icons false