Skip to content

Instantly share code, notes, and snippets.

@zaptrem
zaptrem / gist:717b168583a323ef8215ada1fb057d1d
Created December 2, 2022 05:34
ChatGPT Improves Itself
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.
#!/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
# 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 May 11, 2024 14:28
AutoScraper Examples

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
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 May 3, 2024 13:42
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/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
@henrych4
henrych4 / download_GoogleDrive.py
Last active January 17, 2024 04:02
A python script for downloading file in google drive
#Reference: https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
@baymaxium
baymaxium / content.md
Created October 18, 2017 08:54
rdiff-backup:一个 Linux 中的远程增量备份工具

原文:Linux中国

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

-- Aaron Kili

本文导航

-依赖10%

@matthewzring
matthewzring / markdown-text-101.md
Last active May 12, 2024 07:04
A guide to Markdown on Discord.

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.
# coding=utf-8
import StringIO
import csv
import requests
from bs4 import BeautifulSoup
import time
import random
from Models import *