Skip to content

Instantly share code, notes, and snippets.

View mathemandy's full-sized avatar
🏠
Working from home

Andy Eshiet mathemandy

🏠
Working from home
View GitHub Profile
@fernandospr
fernandospr / MockingTextUtilsMethods.kt
Last active May 31, 2022 06:42
Shows how to mock TextUtils methods so that it's possible to unit test classes that use them
import android.text.TextUtils
import io.mockk.every
import io.mockk.mockkStatic
import org.junit.Assert
import org.junit.Test
class TextValidator {
fun validate(string: String) = !TextUtils.isEmpty(string)
}
@JosephmBassey
JosephmBassey / nginx.conf
Last active March 1, 2020 17:29
An nginx conf for routing sub domain request to different port with ssl support. You can repeat this for as many sites as required, you just defines an additional server block(s) for each site(sub domain). Note that this strategy requires TLS SNI support on both server and client
server {
listen 80;
server_name admin.mysite.com www.admin.mysite.com;
}
server{
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName