Skip to content

Instantly share code, notes, and snippets.

View franga2000's full-sized avatar

Miha Frangež franga2000

View GitHub Profile
@andrewroberts
andrewroberts / exportSpreadsheet.gs
Last active August 10, 2023 09:53 — forked from Spencer-Easton/exportSpreadsheet.gs
Example on how to export a Google sheet to various formats, includes most PDF options. Updated from comments in [Spencer Easton's Gist](https://gist.github.com/Spencer-Easton/78f9867a691e549c9c70)
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@dpetukhov
dpetukhov / rupluralize.py
Last active September 7, 2023 14:39 — forked from xfenix/rupluralize.py
Russian pluralize django template tag
@register.filter(is_safe = False)
@stringfilter
def pluralize(value, forms):
"""
Подбирает окончание существительному после числа
{{someval|pluralize:"товар,товара,товаров"}}
"""
try:
one, two, many = forms.split(u',')
value = str(value)[-2:] # 314 -> 14
@frebib
frebib / hibereboot
Last active March 11, 2024 06:10
hibereboot: A 'hibernate & reboot' one-shot hack script for systemd-based hosts
#!/bin/sh
set -e
# hibereboot: A 'hibernate & reboot' one-shot hack script for systemd-based hosts
#
# Place this script somewhere in your $PATH and run it (as root) to hibernate and reboot.
# For full automation, allow the script to be run with passwordless-sudo:
#
# > /etc/sudoers
# yourusername ALL=(ALL) SETENV:NOPASSWD: /path/to/hibereboot
// ==UserScript==
// @name WiGLE MAC address manufacturer lookup
// @namespace com.franga2000
// @downloadUrl https://gist.githubusercontent.com/franga2000/e9fe898fb2f0efeaf284598dff6e216c/raw/GM_WiGLE_OUI.js
// @match https://wigle.net/mapsearch*
// @run-at document-idle
// @grant none
// ==/UserScript==
function loadTitle(el) {
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@franga2000
franga2000 / Ubuntu on Acer Aspire Switch 10.md
Last active January 31, 2024 21:40
Ubuntu on Acer Aspire Switch 10

Ubuntu on Acer Aspire Switch

The problem

What's the problem with this tablet? Why can't I just insert the USB and mash F12 until it boots? The tablet is made to run Windows 8.1 and Windows 8.1 only. Some absolute genius at Acer decided to put a 32-bit UEFI on a 64-bit system, which no reasonable Linux distro supports out-of-the-box.

NOTE: This guide focuses on installing Ubuntu alongside Windows. If you're trying to replace Windows, then I assume you know enough about Linux to know which parts to change.

What works:

  • Keyboard
@gersilex
gersilex / lgtv-nec-ir-codes.txt
Last active January 25, 2021 14:53
LG TV 2008-2013 NEC IR Codes
All codes are in hexadecimal NEC format, 32 bits long. Ready to use with IRLib Arduino library.
### DISCRETE INPUTS ###
Tuner 20DF6B94
HDMI1 20DF738C
HDMI2 20DF33CC
HDMI3 20DF9768
HDMI4 20DF5BA4
@sushain97
sushain97 / fb.py
Last active June 11, 2019 21:01
Downloads, archives, analyzes and plots Facebook Messenger conversations (individual and group)
#!/usr/bin/env python3
__author__ = 'Sushain K. Cherivirala'
import argparse
import cmd
import collections
import contextlib
import copy
import datetime
string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".
@sillypog
sillypog / major_us_city_dma_codes.py
Created November 15, 2012 17:59 — forked from ecarter/major_us_city_dma_codes.py
Major US Cities with Latitude/Longitude and DMA Codes
# Major US Cities with DMA Codes
major_cities = [
{'city': 'Ada', 'dma_code': 657, 'latitude': 34.774531000000003, 'longitude': -96.678344899999999, 'region': 'OK', 'slug': 'ada-ok'},
{'city': 'Akron', 'dma_code': 510, 'latitude': 41.081444699999999, 'longitude': -81.519005300000003, 'region': 'OH', 'slug': 'akron-oh'},
{'city': 'Albany', 'dma_code': 525, 'latitude': 31.578507399999999, 'longitude': -84.155741000000006, 'region': 'GA', 'slug': 'albany-ga'},
{'city': 'Alexandria', 'dma_code': 644, 'latitude': 31.311293599999999, 'longitude': -92.445137099999997, 'region': 'LA', 'slug': 'alexandria-la'},
{'city': 'Alpena', 'dma_code': 583, 'latitude': 45.061679400000003, 'longitude': -83.432752800000003, 'region': 'MI', 'slug': 'alpena-mi'},
{'city': 'Altoona', 'dma_code': 574, 'latitude': 40.5186809, 'longitude': -78.394735900000001, 'region': 'PA', 'slug': 'altoona-pa'},
{'city': 'Amarillo', 'dma_code': 634, 'latitude': 35.221997100000003, 'longitude': -101.8312969, 'region': 'TX', 'slug': 'amarillo-tx'},