Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile
package my.example.compat;
* NOTICE: modified since 2023 and later.
* Copyright (C) 2008 The Android Open Source Project
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
glowinthedark / RsyncBackup.js
Last active May 30, 2024 12:03
MacOS RsyncBackup — simplest possible rsync GUI for MacOS
#!/usr/bin/osascript -l JavaScript
// The SHEBANG is only needed if the file is executable and is run from a terminal with `./RsyncBackup.js`
// 1. In MacOS Spotlight type 'Script Editor' and paste the code below
// 2. Click the top-left dropdown which says 'AppleScript' and select 'JavaScript'
// 3. Under menu File pick Export
// 4. In the Export dialog select File Format = Application
// 5. Save the app in /Applications
glowinthedark /
Created April 3, 2020 21:35 — forked from gnilchee/
Multi-threaded Python3 HTTP Server
#!/usr/bin/env python3
import sys, os, socket
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
HOST = socket.gethostname()
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
sudoxx2 /
Last active October 29, 2023 18:34
from selenium import webdriver
from import Options
import os
# function to take care of downloading file
def enable_download_headless(browser,download_dir):
browser.command_executor._commands["send_command"] = ("POST", '/session/$sessionId/chromium/send_command')
params = {'cmd':'Page.setDownloadBehavior', 'params': {'behavior': 'allow', 'downloadPath': download_dir}}
browser.execute("send_command", params)
pcgeek86 /
Last active May 31, 2024 16:42 — forked from random-robbie/
Install Go Lang on Raspberry Pi
cd $HOME
sudo tar -C /usr/local -xvf $FileName
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
source ~/.bashrc
tivnet / ACE Editor: submit, beautify and minify.html
Last active January 24, 2023 20:17
ACE Editor: submit, beautify and minify
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>ACE Editor: submit, beautify and minify</title>
<style type="text/css" media="screen">
#ace_js, #ace_css {
width: 95%;
height: 15em;
border: 1px solid silver;
Juraji / obs_lua_digital_clock.lua
Created January 25, 2018 21:17
An OBS script for turning a text source into a 24h digital clock with timezone designation. (Supports dst)
-- Created by IntelliJ IDEA.
-- User: Juraji
-- Date: 25-1-2018
-- Time: 19:51
-- Binds to a text source and shows the current time in 24h format
-- appended with the current timezone designation.
-- The timezone designations for both dst and non-dst can be changed
-- by updating the dst_ variables below
banhaclong20 / Touch swipe detection in pure JavaScript
Created November 2, 2017 22:41
Touch swipe detection in pure JavaScript
<div id="swipezone">
Swipe me
// credit:
function swipedetect(el, callback){
var touchsurface = el,
sofaking /
Created March 3, 2017 10:48
Get battery level via adb
adb shell dumpsys battery | grep level
alexeygrigorev /
Created September 17, 2016 09:09
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = ',426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()