Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@pablox-cl
pablox-cl / csv2yaml.rb
Created November 7, 2010 17:14 — forked from reservationlive/Ruby script to convert CSV to YAML
Simple Ruby CSV to YAML converter
#!/usr/bin/env ruby
#
# Originally written by http://redartisan.com/tags/csv
# Added and minor changes by Gavin Laking
#
# "id","name","mime_type","extensions","icon_url"
# "1","unknown","unknown/unknown","||","/images/icon/file_unknown.gif"
# "2","image/tiff","image/tiff","|tiff|tif|","/images/icon/blank.png"
#
# if you want to remove the id: "number" line from the resulting YAML file
anonymous
anonymous / gist:713716
Created November 24, 2010 14:22
#!/c/WebServers/usr/local/php5/php
<?php echo 123 ?>
@carolineschnapp
carolineschnapp / google_translate.html
Created February 1, 2011 19:27
Google Translate Embed Code
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
@SignpostMarv
SignpostMarv / github-commit-diff-link.user.js
Created March 14, 2011 15:33
github.com raw diff link greasemonkey script
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@samsoir
samsoir / staging.rebuild.sh
Created April 12, 2011 16:36
Rebuild script for the OU Annotate Staging Server
#!/bin/bash
# +--------------------------------------------------------------------------+
# | OU Annotate Staging Rebuild Script |
# | Written by Sam de Freyssinet <sam@def.reyssi.net> |
# +--------------------------------------------------------------------------+
# | Permission to use, copy, modify, and/or distribute this software for any |
# | purpose with or without fee is hereby granted, provided that the above |
# | copyright notice and this permission notice appear in all copies. |
# +--------------------------------------------------------------------------+
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@boyvanamstel
boyvanamstel / gist:1055880
Created June 30, 2011 08:52
Show custom post types on tag, category and archive pages in Wordpress
<?php
/**
* Also show custom post types in tag/category/archive pages
*/
function query_post_type($query) {
if(is_category() || is_tag()) {
$post_type = get_query_var('post_type');
if($post_type) {
$post_type = $post_type;
} else {
@benschwarz
benschwarz / index.html
Last active November 6, 2023 21:10
Using ARIA roles with <header>, <footer> and <aside>
<!doctype html>
<html>
<body>
<header role="banner">
<a href="/" rel="home">My company</a>
<nav role="navigation">
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
</header>
@Munawwar
Munawwar / test.html
Last active January 10, 2017 01:45
IE8 polyfill for HTML5 Range object's startContainer, startOffset, endContainer and endOffset properties.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
/*
This code is a IE8 (and below), polyfill for HTML5 Range object's startContainer,
startOffset, endContainer and endOffset properties.
*/
(function () {
function findTextNode(node, text) {