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 pathlib import Path | |
import torch | |
import glob | |
from lightglue import LightGlue, SuperPoint, DISK, SIFT, ALIKED, DoGHardNet | |
from lightglue.utils import load_image, rbd | |
from lightglue import viz2d | |
torch.set_grad_enabled(False) |
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
require 'mechanize' | |
def facebook_page_status_update(email,password,page_name,message) | |
agent = Mechanize.new | |
agent.user_agent_alias = 'Android' | |
#go to the login page | |
login_page = agent.get('https://m.facebook.com/') |
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
// | |
// loads remote file using fetch() streams and "pipe" it to webaudio API | |
// remote file must have CORS enabled if on another domain | |
// | |
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api | |
// | |
function appendBuffer( buffer1, buffer2 ) { | |
var tmp = new Uint8Array( buffer1.byteLength + buffer2.byteLength ); | |
tmp.set( new Uint8Array( buffer1 ), 0 ); |
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
require 'rubygems' | |
require 'serialport' | |
class RelayDriver | |
def initialize | |
#params for serial port | |
port_str = "/dev/tty.usbmodem00024841" #may be different for you | |
baud_rate = 19200 | |
data_bits = 8 |
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
#!/bin/ruby | |
# | |
# Implements a simple music quiz. | |
# | |
# With a list of correct | |
# answers and a button, attached via serial. When the button | |
# is pressed, the meta data of the currently playing song in | |
# Spotify is checked, and if the currently playing song is | |
# in the list of correct songs a 'winner' sound file is played | |
# using aplay. If the currenlty playing song is not correct, a |
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
#!/usr/bin/python | |
# | |
# now_playing.py | |
# | |
# Python script to fetch the meta data of the currently playing | |
# track in Spotify. This is tested on Ubuntu. | |
import dbus | |
bus = dbus.SessionBus() | |
try: |
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
#!/usr/bin/osascript | |
# | |
# now_playing.osascript | |
# | |
# Osascript to fetch the meta data of the currently playing | |
# track in Spotify. This works only on Mac OS X. | |
tell application "System Events" | |
set myList to (name of every process) | |
end tell |