Skip to content

Instantly share code, notes, and snippets.

View u01jmg3's full-sized avatar
🔷
Coding Hard

Jonathan Goode u01jmg3

🔷
Coding Hard
View GitHub Profile
@mrcgrtz
mrcgrtz / timestamp2excel.txt
Created June 8, 2010 08:30
Formula to convert a UNIX timestamp (in cell A1) to Excel date format.
=DATE(1970;1;1)+(LEFT(A1;10)/24/60/60)
@vbfox
vbfox / Program.cs
Created August 26, 2010 15:33
Sample code for SHOpenFolderAndSelectItems in C#
namespace SHOpenFolderAndSelectItems
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
@mattattui
mattattui / gist:879249
Created March 21, 2011 10:08
Convert named HTML entities to numeric for XML compatibility
<?php
/* html_convert_entities($string) -- convert named HTML entities to
* XML-compatible numeric entities.
*/
function html_convert_entities($string) {
return preg_replace_callback('/&([a-zA-Z][a-zA-Z0-9]+);/S',
'convert_entity', $string);
}
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@scottjehl
scottjehl / anchorinclude.js
Created May 20, 2011 17:04
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>
@lukemorton
lukemorton / event-source.html
Created June 1, 2011 16:46 — forked from rwaldron/event-source.html
EventSource: The Glorified Long Polling Machine
Open your console.
<script src="event-source.js"></script>
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@komlenic
komlenic / DOMElement.innerHTML.php
Created November 17, 2011 18:54
Get innerHTML of a php DOMElement
<?php
// See http://www.php.net/manual/en/class.domelement.php#101243
function get_inner_html( $node ) {
$innerHTML= '';
$children = $node->childNodes;
foreach ($children as $child) {
$innerHTML .= $child->ownerDocument->saveXML( $child );
}
return $innerHTML;
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/