Skip to content

Instantly share code, notes, and snippets.

View DylanVann's full-sized avatar
🤖

Dylan Vann DylanVann

🤖
View GitHub Profile
@mikelikespie
mikelikespie / PGGeometry.hh
Created September 25, 2011 20:28
Wrappers to overload operations with CGPoint, CGSize, and CGRect.
//
// PGGeometry.hh
// PonyGrid
//
// Created by Mike Lewis on 9/23/11.
// Copyright (c) 2011 Square, Inc. All rights reserved.
//
#ifndef PonyGrid_PGGeometry_hh
#define PonyGrid_PGGeometry_hh
@bvaudour
bvaudour / compress.sh
Last active April 23, 2025 07:07
tar.lz4 creation/extraction
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage : $0 <file to compress>"
exit 1
fi
file=${1%%/}
tar c "$file" | lz4 -z - "$file.tar.lz4"
@TWiStErRob
TWiStErRob / OkHttpProgressGlideModule.java
Last active June 4, 2026 23:00
Full POC for showing progress of loading in Glide v3 via OkHttp v2
// TODO add <meta-data android:value="GlideModule" android:name="....OkHttpProgressGlideModule" />
// TODO add <meta-data android:value="GlideModule" tools:node="remove" android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule" />
// or not use 'okhttp@aar' in Gradle depdendencies
public class OkHttpProgressGlideModule implements GlideModule {
@Override public void applyOptions(Context context, GlideBuilder builder) { }
@Override public void registerComponents(Context context, Glide glide) {
OkHttpClient client = new OkHttpClient();
client.networkInterceptors().add(createInterceptor(new DispatchingProgressListener()));
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client));
}
@alirezaomidi
alirezaomidi / openconnect.sh
Last active November 28, 2023 12:04
Script to connect and disconnect to/from openconnect without pain
#!/bin/bash
# This script connects the computer to a vpn server using openconnect without pain
prog_name=$(basename $0)
# CHANGE YOUR_VPN_SERVER_DOMAIN to the VPN server you know like example.com
domain=YOUR_VPN_SERVER_DOMAIN
function help {