This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from bs4 import BeautifulSoup | |
import requests | |
import gdown | |
import json | |
import argparse | |
parser=argparse.ArgumentParser() | |
parser.add_argument("url") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .download import download | |
from bs4 import BeautifulSoup | |
import json | |
import re | |
import requests | |
import sys | |
if sys.version_info.major < 3: | |
from pathlib2 import Path | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function notify_when_online(){ | |
host=$1 | |
while true; do | |
ping -c1 $host > /dev/null && break; | |
done && notify-send --icon=dialog-information "$host is online" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you need this in your cargo.toml | |
// reqwest = { version = "0.11.3", features = ["stream"] } | |
// futures-util = "0.3.14" | |
// indicatif = "0.15.0" | |
use std::cmp::min; | |
use std::fs::File; | |
use std::io::Write; | |
use reqwest::Client; | |
use indicatif::{ProgressBar, ProgressStyle}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func printJson(data interface{}) { | |
bs, err := json.MarshalIndent(data, "", " ") | |
if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt; | |
#[derive(Debug, Clone, Copy)] | |
struct Point { | |
x: f64, | |
y: f64, | |
} | |
impl fmt::Display for Point { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt; | |
#[derive(Debug, Clone, Copy)] | |
struct Point { | |
x: f64, | |
y: f64, | |
} | |
impl fmt::Display for Point { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:qr_code_scanner/qr_code_scanner.dart'; | |
class ScannerWidget extends StatefulWidget { | |
final BarcodeFormat format; | |
final void Function(String?) onScan; | |
ScannerWidget({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class TabControllerWithOnChange extends TabController { | |
TabControllerWithOnChange({ | |
int initialIndex = 0, | |
required int length, | |
required TickerProvider vsync, | |
required void Function(int) onChange, | |
}) : super(initialIndex: initialIndex, length: length, vsync: vsync) { | |
addListener(() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put file in /etc/X11/xorg.conf.d/40-microsoft-mouse.conf | |
# use xinput list-props "Microsoft Microsoft® Classic IntelliMouse®" to get all options | |
# use xinput set-prop "Microsoft Microsoft® Classic IntelliMouse®" "OPTION" "OPTIONVALUE" to test an option | |
Section "InputClass" | |
Identifier "Microsoft Mouse" | |
MatchProduct "Microsoft Microsoft® Classic IntelliMouse®" | |
Driver "libinput" | |
Option "TransformationMatrix" "2.4 0 0 0 2.4 0 0 0 1" | |
EndSection |