Skip to content

Instantly share code, notes, and snippets.

Avatar

Dimitris Gravanis dimgrav

View GitHub Profile
@ragecryx
ragecryx / antd_ordering_filter.py
Last active Jul 22, 2019
AntDesign Table x Django-Filters -- Ascend/Descend parameters support
View antd_ordering_filter.py
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 Feb 26, 2020
Programatically join Wi-Fi network on iOS with React Native wrapper for NEHotspotConfiguration
View IOSWifiManager.h
// 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>
@joepie91
joepie91 / vpn.md
Last active Oct 26, 2020
Don't use VPN services.
View vpn.md

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 Mar 25, 2020
Compile and deploy React Native Android app of Release version to device.
View gist:5a71e9d0a6a2c6d6263c
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 Jul 4, 2014
warm.sh | A red+green tint effect for the entire screen
View warm.sh
#!/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 Oct 14, 2019
A simple unix/linux daemon in Python
View daemon.md

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.

You can’t perform that action at this time.