Skip to content

Instantly share code, notes, and snippets.

@zaptrem
zaptrem / gist:717b168583a323ef8215ada1fb057d1d
Created December 2, 2022 05:34
ChatGPT Improves Itself
View gist:717b168583a323ef8215ada1fb057d1d
javascript:(function() {
var timeout = null;
var delay = 1000;
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
document.head.appendChild(script);
script.addEventListener('load', function() {
var mathJaxConfig = {
@ppkliu
ppkliu / scpi_tcp.py
Created May 22, 2021 02:34 — forked from pklaus/scpi_tcp.py
Python script to send commands to a Rigol scope (or any LXI/SCPI instrument) from first principles.
View scpi_tcp.py
#!/usr/bin/env python
"""
Zeroconf Discovery for Rigol DS1000Z-series scopes
--------------------------------------------------
Documentation worth looking at:
* http://lxistandard.org/Documents/Specifications/LXI%20Device%20Specification%202011%20rev%201.4.pdf
* http://lxistandard.org/GuidesForUsingLXI/Introducing%20LXI%20To%20Your%20Network%20Administrator%20May%2024_2013.pdf
* http://lxistandard.org/GuidesForUsingLXI/LXI_Getting_Started_Guide_May_1_2013.pdf
@hypoxic
hypoxic / tds3034.py
Created October 15, 2020 01:54
Code used to capture a waveform from the Tek TDS3000 series and send it to python
View tds3034.py
# Hypoxic Capture via TDS 3034B
# Requires pyvisa and NI-VISA, not tested much, but figured I'd share as it would be helpful for others
import pyvisa
import numpy as np
import time as time
class Tek:
def __init__(self, source = "CH1"):
self.timeout = 5.0
@alirezamika
alirezamika / autoscraper-examples.md
Last active August 29, 2023 14:28
AutoScraper Examples
View autoscraper-examples.md

Grouping results and removing unwanted ones

Here we want to scrape product name, price and rating from ebay product pages:

url = 'https://www.ebay.com/itm/Sony-PlayStation-4-PS4-Pro-1TB-4K-Console-Black/203084236670' 

wanted_list = ['Sony PlayStation 4 PS4 Pro 1TB 4K Console - Black', 'US $349.99', '4.8'] 

scraper.build(url, wanted_list)
@decoc
decoc / CompileLocker.cs
Last active February 11, 2023 08:48
This editor utility can lock/unlock unity script compile from menu item. See more https://raspberly.hateblo.jp/entry/InvalidateUnityCompile
View CompileLocker.cs
using UnityEngine;
using UnityEditor;
/// <summary>
/// This editor utility can lock/unlock unity script compile from menu item.
/// See more https://raspberly.hateblo.jp/entry/InvalidateUnityCompile
/// </summary>
public static class CompileLocker
{
[MenuItem("Compile/Lock", false, 1)]
@pirate
pirate / docker-compose-backup.sh
Last active September 4, 2023 21:45
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
View docker-compose-backup.sh
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@baymaxium
baymaxium / content.md
Created October 18, 2017 08:54
rdiff-backup:一个 Linux 中的远程增量备份工具
View content.md

原文:Linux中国

rdiff-backup 是一个用于本地/远程增量备份的强大而易用的 Python 脚本,它适用于任何 POSIX 操作系统,如Linux、Mac OS X 或 Cygwin。它集合了镜像和增量备份的显著特性。

-- Aaron Kili

本文导航

-依赖10%

@matthewzring
matthewzring / markdown-text-101.md
Last active September 28, 2023 15:51
A guide to Markdown on Discord.
View markdown-text-101.md

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@dolphinsue319
dolphinsue319 / fetch_stocks_price.py
Created March 3, 2017 09:25
Fetch Taiwan OTC stocks price.
View fetch_stocks_price.py
# coding=utf-8
import StringIO
import csv
import requests
from bs4 import BeautifulSoup
import time
import random
from Models import *
@HeraclesJam
HeraclesJam / [aria2] aria2.conf
Last active March 27, 2023 03:58
aria2.conf 設定檔的範例
View [aria2] aria2.conf
## Basic Options ##
# 下載目錄
dir=/mnt/usb
# 進度紀錄
input-file=/mnt/usb/.aria2/aria2.session
# 同時進行任務數
max-concurrent-downloads=10
# 斷線續傳
continue=true