Skip to content

Instantly share code, notes, and snippets.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
if (typeof jQuery === 'undefined') {
var e = document.createElement('script');
e.src = 'js/jquery-1.4.3-min.js';
e.type='text/javascript';
document.getElementsByTagName('head')[0].appendChild(e);
}
</script>
<div id="sales" class="sub_banner">
<div class="max">
<h2>Contact [CountryName] support</h2>
<a href="[callback_url]" class="callback">Arrange callback</a>
<ul class="contacts">
<li id="hcard-[forename]-[surname]" class="vcard{if usr_region}{if (usr_region != region)} secondary{endif}{endif}">
<h3 class="fn"><a href="mailto:[forename].[surname]@spilasers.com" class="email" title="Email [Forename]">[Forename] [Surname]</a></h3>
<ul>
<li class="img"><img class="photo" src="foo" alt="[Forename] [Surname]"></li>
{if region}<li class="title">[CountryName] [Region]</li>{endif}
@watershed
watershed / add_skip.js
Created February 9, 2011 12:58
Add skip to section links
// Add skip links to sections
SECT.add_skip = function() {
// Create a placeholder we can append to
var $skip = $('<div class="skip"></div>');
$('.body .section').each(function(){
_section = $(this);
// Check the section has an id we can link to and a subheading
if (_section.attr('id').length && (_section.find('h2').length > 0) ) {
@watershed
watershed / compare_cell_example.html
Created June 4, 2011 07:45
Compare table cell example
<!-- Example cell with JavaScript on -->
<td class="linked">
<a href="/Datasheets/redPOWER_R4/100-400W_RS_series.aspx?" title="View RS datasheet">
<a title="View RS datasheet" href="/Datasheets/redPOWER_R4/100-400W_RS_series.aspx?">
<em class="good">Good</em>
</a>
</a>
</td>
<!-- Same cell with JavaScript off (HTML sent to browser) -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>A menu experiment with slanting list items</title>
<style type="text/css" title="text/css" media="screen">
<!--
* {margin: 0; padding: 0;}
@watershed
watershed / management-bios.html
Created October 6, 2011 12:26
Management styling in IE7
<!-- The nested structure is at present like this -->
<div class="panel vcard" id="[hcard-forename-surname]">
<div class="header">
<h2 class="fn h3">[Forename] [Surname]</h2>
<div class="title">[Job title]</div>
</div>
<div class="figure left1of3">
<img alt="[Forename] [Surname]" src="[image_url]" class="photo">
</div>
<div class="bio">
@watershed
watershed / craft-instruction-links.js
Last active January 2, 2016 14:44
CraftCMS: force links in field instructions to open in a new window
@watershed
watershed / select-files-from-list.scpt
Created June 14, 2018 08:52
Select files from list AppleScript
set myValues to {"filename.ext", "filename.ext"}
tell application "Finder" to set fileList to files of target of front Finder window as alias list
set matchedFiles to {}
repeat with aFile in my fileList
repeat with aValue in myValues
tell application "System Events" to if aFile's name contains (contents of aValue) then set end of matchedFiles to (aFile as text)
end repeat
end repeat
@watershed
watershed / update-multiple-rows-same-column.sql
Created June 14, 2018 08:54
MySQL: update multiple rows for the same column/field
UPDATE table_name
SET field_to_update = CASE id
WHEN n THEN 'Text value'
END
WHERE id IN (n)
@watershed
watershed / rename-files-in-folder-to-all-lowercase.sh
Created June 19, 2018 16:42
Rename files in folder to all lowercase
for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done