Skip to content

Instantly share code, notes, and snippets.

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

Dimitris Gravanis dimgrav

🏠
Working from home
  • Greece
View GitHub Profile
@ragecryx
ragecryx / antd_ordering_filter.py
Last active July 22, 2019 07:57
AntDesign Table x Django-Filters -- Ascend/Descend parameters support
class AntCompatibleOrderingFilter(filters.OrderingFilter):
def __init__(self, *args, **kwargs):
super(AntCompatibleOrderingFilter, self).__init__(*args, **kwargs)
def build_choices(self, fields, labels):
"""
Adds support for {field}-ascend and {field}-descend choices
"""
ascending = [
(f"{param}-ascend", labels.get(field, _(pretty_name(param))))
@rbresjer
rbresjer / IOSWifiManager.h
Last active August 31, 2021 11:23
Programatically join Wi-Fi network on iOS with React Native wrapper for NEHotspotConfiguration
// Created by Rutger Bresjer on 10/10/2017
// Notes:
// - Be sure to enable "Hotspot Configuration" capability for the iOS target
// - Make sure the NetworkExtension framework is linked to the target
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
@interface IOSWifiManager : NSObject <RCTBridgeModule>
@jleclanche
jleclanche / freeotp_backup.md
Last active February 8, 2024 12:26
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

NOTE: THIS MAY NOT WORK ANYMORE - SEE COMMENTS

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@joepie91
joepie91 / vpn.md
Last active April 17, 2024 18:05
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@hrj
hrj / warm.sh
Created July 4, 2014 03:26
warm.sh | A red+green tint effect for the entire screen
#!/bin/bash
# Call with a percentage value from 0 to 100
# 0 means only red and green, 50 means half of blue is shown through
# if you don't give any arguments the calibration is cleared
if [[ -z "$1" ]]; then
echo Clearing all calibrations
xcalib -clear
else
@andreif
andreif / daemon.md
Last active December 7, 2022 16:53
A simple unix/linux daemon in Python

A simple unix/linux daemon in Python

Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Access: http://web.archive.org/web/20131025230048/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

by Sander Marechal

I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.