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 os import listdir | |
from os.path import basename, isfile, join, splitext | |
src_dir = 'c:\\repository\\' | |
files = {} | |
for file in listdir(src_dir): | |
src_file = join(src_dir, file) | |
if isfile(src_file): | |
base = splitext(basename(src_file))[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
// CHARACTER / WORD counter demo - uses Jquery | |
$(document).ready(function () { | |
// input with #characters and accompanying span with #c_length | |
$("#characters").keyup(function() { | |
$('#c_length').html($(this).val().length); | |
}); | |
// input with #words and accompanying span with #w_length |
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
INSERT INTO `tblSubjects_Subjects` ( | |
`Subject`, | |
`SubjectTypeID`, | |
`SubjectSourceID` | |
) | |
VALUES | |
('Advisory boards, California, Sonoma County', 1, 1), | |
('Alien property, California, Sonoma County', 1, 1), | |
('Animal welfare, California, Santa Rosa', 1, 1), | |
('Sonoma County Teachers'' Institute', 3, 1), |
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
# Ruby script to convert video files using HandBrakeCLI | |
# @path from extension i_ to o_ using preset | |
# Skips processing if output file already exists | |
# http://handbrake.fr/downloads2.php | |
path = 'X:Movies/*' # Change to desired location | |
i_ext = 'mkv' # input file extension | |
o_ext = 'mp4' # output file extension | |
preset = 'iPad' # HandBrake preset | |
Dir[path].each do |file| | |
if file =~ /\.#{i_ext}$/ |
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
package net.libcode.www.frequentutilities.net; | |
import org.jsoup.Connection; | |
import org.jsoup.Connection.Response; | |
import org.jsoup.Jsoup; | |
public class NetUtilities { | |
/** | |
* Checks link validity by evaluating HTTP headers |
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 'marc_tools' | |
# https://github.com/mark-cooper/marc_tools | |
# SCL branches (to exclude consortial partner branches) | |
BRANCHES = [ | |
'cent', | |
'clov', | |
'fore', | |
'guer', | |
'heal', |
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 'marc_tools' | |
# https://github.com/mark-cooper/marc_tools | |
# SCL branches (to exclude consortial partner branches) | |
BRANCHES = [ | |
'cent', | |
'clov', | |
'fore', | |
'guer', | |
'heal', |
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
jQuery(function() { | |
// Cross Domain Policy restricted (obviously) | |
$.get('https://server15763.contentdm.oclc.org/dmwebservices/index.php?q=dmGetItemInfo/p15763coll5/149/json', function(data) { | |
console.log(data); | |
}, 'json'); | |
// JSONP not supported | |
$.get('https://server15763.contentdm.oclc.org/dmwebservices/index.php?q=dmGetItemInfo/p15763coll5/149/json', function(data) { | |
console.log(data); | |
}, 'jsonp'); |
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
<?php // 5.3 | |
// From: http://pear.php.net/package/File_MARC | |
require 'File/MARC.php'; | |
// From: https://github.com/abelperez/php-commons | |
require '../lib/collections/SimpleIterator.php'; | |
require '../lib/collections/Set.php'; | |
require '../lib/collections/ArraySet.php'; | |
// Create a datafield | |
$a = new File_MARC_Data_Field('245', null, 1, 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
# TRANSFORM SUBJECT HEADINGS EXAMPLE | |
require 'marc' | |
# Function: text_to_datafield | |
# Returns a vanilla MARC::DataField object from string | |
# Format examples: | |
# 655 _0 Account books. | |
# 655 _7 3-D films.|2lcgft | |
def text_to_datafield(text_field) |
OlderNewer