This file contains 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/bash | |
# | |
# Put an 8250 or SFD-1001 into 8050 mode using cbmctrl. | |
# http://www.softwolves.com/arkiv/cbm-hackers/2/2411.html | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 <unit number>" | |
exit 2 | |
fi |
This file contains 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/env python | |
# 8-bit binary counter for the LabJack U3's FIO lines | |
import time | |
import u3 | |
dev = u3.U3() | |
# disable timers so they don't interfere with FIO | |
dev.configIO(NumberOfTimersEnabled=0) |
This file contains 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/env python | |
# | |
# |<------->| Measure the time between two rising | |
# edges on the LabJack's FIO4 pin, | |
# +----+ +----+ then calculate the frequency in Hertz. | |
# | | | | | |
# ----+ +----+ +---- | |
import time | |
import u3 |
This file contains 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/env python | |
# Generate a single pulse of ~5 microseconds on the LabJack U3's FIO4 pin. | |
import LabJackPython | |
import u3 | |
dev = u3.U3() | |
# fio4: timer 0 (frequency out) | |
# fio5: timer 1 (timer stop) |
This file contains 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/bash | |
# | |
# Put a 1571 into double-sided (1571) or single-sided (1541) mode | |
# using cbmctrl. | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 <unit number> <1541|1571>" | |
exit 2 | |
fi |
This file contains 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/env ruby | |
# Ruby script to generate VICE monitor labels from | |
# an XAsm listing file. | |
filename = ARGV[0] | |
if filename | |
lines = File.readlines(filename) | |
else | |
abort "Usage: vice-labels.rb <filename>" |
This file contains 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
<?php | |
/** | |
* Trim unnecessary whitespace from an HTML file or ERB template. | |
* | |
* This is taken directly from Smarty 3.1.7 (http://www.smarty.net): | |
* libs/plugins.outfilter.trimwhitespace.php | |
* | |
* Changes: | |
* - Removed argument "Smarty_Internal_Template $smarty". |
This file contains 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
// ==UserScript== | |
// @name Highlight Rails I18n Missing Translations | |
// @namespace http://mikenaberezny.com | |
// @description Highlight and console.log missing translations from Rails I18n. | |
// @include * | |
// ==/UserScript== | |
// Rails I18n wraps missing translations in <span class="translation_missing"> | |
var elements = document.getElementsByClassName("translation_missing"); |
This file contains 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
DROP TRIGGER phpbb_config_insert_tpl_allow_php; | |
DROP TRIGGER phpbb_config_update_tpl_allow_php; | |
DELIMITER ;; | |
CREATE TRIGGER phpbb_config_insert_tpl_allow_php BEFORE INSERT ON phpbb_config FOR EACH ROW | |
IF (NEW.config_name = 'tpl_allow_php') THEN | |
SET NEW.config_value = 0; | |
SET NEW.is_dynamic = 0; | |
END IF;; |
This file contains 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 'pp' | |
class PP | |
class CompactSingleLine < SingleLine | |
# output comma separators as "," instead of ", " to save bytes | |
def comma_breakable | |
text "," | |
end | |
end |
OlderNewer