Skip to content

Instantly share code, notes, and snippets.

View erawhctim's full-sized avatar

Mitch Ware erawhctim

  • Atlanta, Georgia
View GitHub Profile
@daniellAlgar
daniellAlgar / Logger.kt
Last active March 28, 2020 10:36
This is a safe way to do logging in your Android apps without running the risk of having Log() statements in your production code. It reduces garbage collection and eliminates the need for a log tag.
package com.?
import android.os.Build
import android.util.Log
import com.varvet.shipgaz.BuildConfig
import java.util.regex.Pattern
/**
* A logger to avoid logging in production. It will check if [BuildConfig.DEBUG] is true or not.
* If true then allow logging, otherwise don't.
@leymannx
leymannx / iterm2-oh-my-fish.md
Last active May 5, 2024 13:53
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@s4y
s4y / resolveWithTimeout.swift
Created February 9, 2015 00:47
NSNetService.resolveWithTimeout (with success callback)
extension NSNetService {
func resolveWithTimeout(timeout: NSTimeInterval, success: () -> ()) {
class NetServiceDelegate: NSObject, NSNetServiceDelegate {
let oldDelegate: NSNetServiceDelegate?
let netService: NSNetService
let success: () -> ()
var holdSelf: NetServiceDelegate?
init(netService: NSNetService, success: () -> ()) {
self.oldDelegate = netService.delegate
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: