Skip to content

Instantly share code, notes, and snippets.

View designermonkey's full-sized avatar

John Porter designermonkey

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date">
<xsl:import href="get-schedule.xsl" />
<!--
Name: XSLT Calendar
@nils-werner
nils-werner / clone
Created April 13, 2011 11:46
Clone a repo, replace the origin remote and initialize all submodules
#!/bin/bash
cd $(pwd)
git clone $1 .
git submodule update --init
git remote rm origin
git remote add upstream $1
git remote add origin $2
#
# Put this file in any of the directories of your PATH (try echo $PATH to see them)
#
@mathiasbynens
mathiasbynens / some-more-info-on-css-hacks.md
Created May 25, 2011 17:33
Some more info on CSS hacks

There seems to be a difference between longhand properties (e.g. background-color) and shorthand properties (e.g. background). Some CSS hacks only work for one or the other. I’ve updated my test case to test these separately, and there are some interesting results.

The following hacks target IE8 but not IE9:

  • longhandproperty: \0value\0;
  • longhandproperty: \0value;

In practice, you might use these like so:

  • background-color: \0red\0;
$(function(){
// Namespace the application
var khepin = {};
// Todo Model
khepin.Todo = Backbone.Model.extend({
defaults: {
task: null,
done: false
@bzerangue
bzerangue / iCal.xsl
Created November 3, 2011 04:54
[XSLT] iCal utility
<?xml version="1.0" encoding="utf-8"?>
<!--
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
X-WR-TIMEZONE;VALUE=TEXT:US/Central
METHOD:PUBLISH
PRODID:-//Park Cities Presbyterian Church\(PCA\)//iCal 1.0//EN
X-WR-CALNAME;VALUE=TEXT:Park Cities Presbyterian Church Events Feed
VERSION:2.0
BEGIN:VEVENT
@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@DavidOliver
DavidOliver / SymCMS - Getting data notes.mkd
Last active March 29, 2019 09:02
Notes on getting data from within Symphony CMS

Written based on hacking away at a custom event which aimed to take its data solely from entry data and $_SESSION values, and not posted values (which I understand may have been open to DOM hacking and required "ugly" frontend hidden fields).

Things I think I've learned

Use Xpath in PHP when possible

I was traversing the XMLElement object generated by SymQL (or Entry object generated by EntryManager) with the object's methods and foreach to get values, which seems to require a lot of effort and code:

php