Skip to content

Instantly share code, notes, and snippets.

@voluntas
voluntas / open_momo.rst
Last active August 17, 2024 07:04
OpenMomo プロジェクト
@nakagami
nakagami / PyConJP2016.rst
Last active December 13, 2023 04:23
How to write python database driver (PyCon JP 2016 talk)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to write python database driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- https://pycon.jp/2016/ja/schedule/presentation/13/
- https://www.youtube.com/watch?v=ax2WmQ_MSXs
- https://togetter.com/li/1028521
========================================
Preface
@pklaus
pklaus / scpi_tcp.py
Last active May 22, 2021 02:34 — forked from GeoSpark/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
$.ajax( {
type: "GET",
url: "/command.cgi?op=190&CTRL=0x1f&DATA=" + value,
cache: true,
dataType: "json",
timeout: 3000,
beforeSend: function( jqXHR, settings ) {
jqXHR.setRequestHeader( "If-Modified-Since", "Thu, 01 Jan 1970 00:00:00 GMT" );
}
} ).done( function( data, textStatus, jqXHR ) {
@edy555
edy555 / blink.rb
Created November 6, 2012 23:44
LED blink with FT232RL bitbang mode and ruby
@jboner
jboner / latency.txt
Last active November 19, 2024 14:58
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@derek-watson
derek-watson / tumblr.rb
Created March 12, 2011 18:47
Tumblr to Jekyll migration
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
# Supports post types: regular, quote, link, photo, video and audio
# Saves local copies of images
require 'rubygems'
require 'open-uri'
require 'nokogiri'