Skip to content

Instantly share code, notes, and snippets.

@sirishn
sirishn / README.md
Created September 6, 2012 21:09
trashy trash

hello

trash trash trash

garbage

@sirishn
sirishn / plotter.rb
Created September 27, 2012 16:41
plotter with logging
#!/usr/bin/env arch -i386 ruby
# wxRuby based plotter for reading opalkelly channel
# hi @ siri.sh
require 'rubygems'
require 'wx'
include Wx
@sirishn
sirishn / grodins2013.rb
Created March 7, 2013 03:34
grodins 2013 research
#!/usr/bin/ruby
# the pseudo-journal of biomedical engineering at USC
# Sirish Nandyala
# nandyala@usc.edu
Paper = Struct.new(:title, :year, :cites)
@papers = []
@papers += [Paper.new("Fabrication and performace of endoscopic ultrasound radial arrays based on PMN-PT single crystal/epoxy 1-3 composite", 2011, 4)]
`timescale 1ns / 1ps
module uart_rx_32(clock, reset, RxD, RxData);
input clock, reset;
input RxD;
//output [7:0] RxData;
output [31:0] RxData;
//reg [10:0]RxRegister;
reg [34:0]RxRegister;
@sirishn
sirishn / uart_tx_32.v
Created March 14, 2013 19:21
uart_tx_32.v
`timescale 1ns / 1ps
module uart_tx_32(clock, reset, TxData, transmit, TxD, state, nextState);
parameter IDLE = 0;
parameter TRANSMITTING=1;
input clock;
input reset;
//input [7:0] TxData;
input [31:0] TxData;
input transmit;
@sirishn
sirishn / 4chan.rb
Created August 24, 2013 15:46
4chan download images from a single thread usage ruby 4chan.rb board OP# example ruby 4chan.rb s4s 816878
#!/usr/bin/ruby
# 4chan downloader (images only)
require 'rubygems'
require 'json'
require 'open-uri'
def get_images(board, post)
@board = board
@sirishn
sirishn / tumblr.rb
Last active December 11, 2018 08:33
tumblr downloader, download all pictures and videos from a tumblog usage ruby tumblr.rb blog #ofposts(optional) example ruby tumblr.rb internet.tumblr.com ruby tumblr.rb internet.tumblr.com 50
#!/usr/bin/ruby
# Tumblr downloader (video and images only)
require 'rubygems'
require 'open-uri'
require 'json'
def get_media(blog, max_posts)
@key = "fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4"
# ;)
@sirishn
sirishn / read_sl_data.rb
Created August 27, 2013 19:15
unpack binary encoded log files from SL into .csv for easy reading
#!/usr/bin/ruby
# Read SL log files
# hi@siri.sh
require 'csv'
@filename = "d00004"
@raw = File.open(@filename)
@sirishn
sirishn / csv_to_plot.py
Created September 5, 2013 19:39
Open .csv log file and plot
#! /usr/bin/python
# Open .csv log file, plot elbow feed forward force and elbow load
import sys
import numpy as np
from pylab import *
from struct import pack, unpack
import csv
@sirishn
sirishn / read_and_plot.rb
Created September 5, 2013 19:40
One-step convert binary encoded SL log and plot it!
#!/usr/bin/ruby
# convert binary-encoded SL log files to .CSV, then plot them
def read_and_plot(filename)
@filename = filename
puts "Converting #{@filename} to .CSV"
system("ruby read_sl_data.rb #{@filename}")