Skip to content

Instantly share code, notes, and snippets.

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

Ken Zhang kennir

🏠
Working from home
View GitHub Profile
@gxfxyz
gxfxyz / karabiner_capslock_control_tab.json
Created May 19, 2019 15:49
Karabiner-Elements config: CapsLock / Control / Tab
{
"title": "CapsLock / Control / Tab",
"rules": [
{
"description": "Tap CapsLock (⇪) → Escape (⎋); Hold CapsLock (⇪) → Control (⌃)",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
@alxsimo
alxsimo / convert_img_byte_array.java
Created March 15, 2016 11:40
[Android] Convert image to bytes[] array with Glide
public static byte[] generateByteArrayProfileImage(Context context, Uri uri)
throws ExecutionException, InterruptedException {
int width = Constantes.PROFILE_IMAGE_SIZE_WIDTH;
int height = Constantes.PROFILE_IMAGE_SIZE_HEIGHT;
return Glide.with(context.getApplicationContext())
.load(uri)
.asBitmap()
.toBytes(Bitmap.CompressFormat.JPEG, 70)
@liortal53
liortal53 / PostBuildHelper.cs
Created January 28, 2016 08:48
Unity: Auto increment iOS build number post build
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
public static class PostBuildHelper
{
[PostProcessBuild]
// LoadingScreenManager
// --------------------------------
// built by Martin Nerurkar (http://www.martin.nerurkar.de)
// for Nowhere Prophet (http://www.noprophet.com)
//
// Licensed under GNU General Public License v3.0
// http://www.gnu.org/licenses/gpl-3.0.txt
using UnityEngine;
using UnityEngine.UI;
@erickok
erickok / OkHttpGzippedLoggingInterceptor.java
Last active February 14, 2024 06:27
Simple logging interceptor for OkHttp that logs full request headers and response headers + body (useful for use with Retrofit 2 where logging was removed)
if (BuildConfig.DEBUG) {
httpclient.interceptors().add(new LoggingInterceptor());
}
public class LoggingInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
long t1 = System.nanoTime();

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!