Skip to content

Instantly share code, notes, and snippets.

View sween's full-sized avatar
💭
Mostly Good Intentions

Ron Sweeney sween

💭
Mostly Good Intentions
View GitHub Profile
private void button4_Click(object sender, EventArgs e)
{
/// This starts the animated image while I do the thing we are going
/// to do.
pictureBox1.Image = SHPortalEnrollment.Properties.Resources.loading;
delegateInstance = new ExampleDelegate(GetResult);
String threadid = Thread.CurrentThread.ManagedThreadId.ToString();
[WebMethod]
public string ConvertRTFtoText(String base64rtf)
{
// Crazy Winform in a Web Service
String plainText = "";
String base64rtfs = "";
try
{
System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox();
require 'rubygems'
require 'dicom'
require 'ruby-growl'
# For Flavor for the Recording
g = Growl.new("localhost", "ruby-growl", ["ruby-growl Notification"], ["ruby-growl Notification"], nil)
g.notify("ruby-growl Notification", "Example C-MOVE with Ruby DICOM", "Starting the Script", 1, true)
sleep(3)
@sween
sween / timelapse.sh
Last active November 29, 2020 12:59
#!/bin/bash
# sample usage: ./timelapsify.sh input.avi output.mp4
mkdir ffmpeg_temp
ffmpeg -i $1 -r 1 -f image2 ffmpeg_temp/%05d.png
ffmpeg -i ffmpeg_temp/%05d.png -sameq $2
rm -rf ./ffmpeg_temp
cd some/directory/with/gopro/images
ffmpeg -r 6 -f image2 -pattern_type glob -i '*.JPG' -s 4000x3000 -c:v mjpeg -q:v 10 ./the-timelapse-video.mov
require ‘rubygems’ require ‘ruby-dicom’
pacs = DICOM::DClient.new("127.0.0.1", 4096, :host_ae => "OSIRIX", :max_package_size => 1500, :timeout => 10)
gar = pacs.test
# Rip through some DICOM, and anonymize
require 'rubygems'
require 'dicom'
require 'benchmark'
a = DICOM::Anonymizer.new
a.add_folder("/Users/sween/Desktop/DICOMA")
puts Benchmark.measure { a.execute }
Here is my benchmark from rbx:
# Rip through some DICOM, and anonymize
require 'rubygems'
require 'dicom'
require 'benchmark'
a = DICOM::Anonymizer.new
a.add_folder("/Users/sween/Desktop/DICOMA")
puts Benchmark.measure { a.execute }
Here is my benchmark from rbx:
sudo virt-install
// —connect qemu:///system
// -n bsd8
// -r 512
// —vcpus=2
// -s 12 -f BSD80.gcow2
// -c 8.0-RELEASE-i386-disc1.iso
// —vnc —noautoconsole
// —accelerate —network=bridge:br0
// —hvm
@sween
sween / rgbmacro.txt
Created October 18, 2010 02:34
Objective C Macro for using RGB Colors
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
cell.textColor = UIColorFromRGB(0x333333);
@sween
sween / ensemble-nagios.cfg
Created November 7, 2010 15:54
Ensemble Plug-In Example Nagios.cfg
# Ensemble Monitoring
# 2010, Ron Sweeney Health Neutral
# A simple configuration file for monitoring Ensemble
# Custom Ensemble services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
#
define host{
use generic-host ; Name of host template to use
host_name ensemble-mac