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
#!/bin/bash | |
# Demunger : ease the pain of double-encoded messy text files | |
# http://www.schwarzvogel.de/software-misc.shtml | |
# | |
# Creates a .new version of each file given on the command line: | |
# $ ./demunger file [file [file [...]]] | |
for i in "$@" ; do | |
sed \ | |
-e 's/é/é/g' -e 's/è/è/g' -e 's/ê/ê/g' -e 's/ë/ë/g' \ |
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
# Helper that adds inline CSS styles to the tags you want from an html string. | |
# Examples: | |
# add_styles("<p>Ohi</p>", :p => 'color:red') # => '<p style="color:red">Ohi</p>' | |
# add_styles("<p>Ohi</p>", :p => {:color => 'red'}) # => '<p style="color:red">Ohi</p>' | |
def add_styles(html, tags) | |
html = html.dup | |
tags.each do |tag, style| | |
style = style.map{|k,v| "#{k}:#{v}"}.join(';') unless style.is_a?(String) | |
html.gsub! /<(#{tag}.*?)(?: style="(.*?)")?(.*?)>/, | |
"<\\1 style=\"#{style};\\2\"\\3>" |
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
#!/usr/bin/env python2.6 | |
# | |
# Riff, rock, and much more !! | |
# | |
# Copyright 2008 Antoine Millet <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
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
Once upon a time, in a far far away land |
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 | |
/* | |
* Patcher | |
* MODx plugin that adds check boxes in the administration to apply .patch | |
* files to MODx core. | |
* | |
* Requirements | |
* ============ | |
* - MODx 0.9.6 | |
* - UNIX system with `mv` and `patch` |
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
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically | |
// Example: | |
// $(document).ready(function() { | |
// ProvideHtml5.autofocus() | |
// ProvideHtml5.datepicker() | |
// ProvideHtml5.forcenumber() | |
// }) | |
// | |
// Now a real git project, over here: http://github.com/sunny/provide-html5 |
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
// Creates a hexon in Raphael | |
// Example: paper.hexagon(50) | |
Raphael.fn.hexagon = function(radius) { | |
var path = "" | |
for (var i = 0; i <= 6; i++) { | |
var a = i * 60, | |
x = radius * Math.cos(a * Math.PI / 180), | |
y = radius * Math.sin(a * Math.PI / 180) | |
path += (i == 0 ? "M" : "L") + x + "," + y | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Lamp shadow</title> | |
<!-- Text-shadow that follows the user's mouse. Hurray! --> | |
<style> | |
#sun { |
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
-- Place this in "/Library/Scripts/Folder Action Scripts/" then add it to the folder actions | |
-- to receive a Growl notification whenever a new file appears | |
on adding folder items to this_folder after receiving added_items | |
tell application "Finder" | |
set the folder_name to the name of this_folder | |
set the item_count to the number of items in the added_items | |
set first_file_name to the name of the first item in added_items | |
end tell |
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
Font stacks based on system fonts | |
--------------------------------- | |
Times New Roman stack | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
Georgia stack: | |
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, Palatino, Palatino Linotype, Times, Times New Roman, serif; | |
Garamond stack |