Skip to content

Instantly share code, notes, and snippets.

@tomgrohl
tomgrohl / Rust.txt
Created January 25, 2012 20:19
Rust Bundle for TextMate
{ scopeName = 'source.rs';
comment = 'Rust Syntax: version 0.1';
fileTypes = ( 'rs', 'jsx' );
foldingStartMarker = '^.*\bfn\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$';
foldingStopMarker = '^\s*\}';
patterns = (
{ name = 'meta.class.rs';
comment = 'match stuff like: Sound.prototype = { … } when extending an object';
match = '([a-zA-Z_?.$][\w?.$]*)\.(prototype)\s*(=)\s*';
captures = {
@tomgrohl
tomgrohl / is_xhtml.js
Created August 24, 2012 23:06
A simple function for getting if a document is XHTML+XML
function getContentType() {
var type = "text/html",
rXHTML_XML = /application\/xhtml\+xml/i,
element = $(document).find("meta[content][http-equiv='Content-Type']");
if( element.length ) {
content = element.attr("content");
@tomgrohl
tomgrohl / README.md
Last active November 16, 2016 08:02
Make Url::secure in Laravel 4 work like Laravel 3

Make URL::secure/Redirect::secure work in Laravel 4 like it did in Laravel 3

In Laravel 3 URL::secure/Redirect::secure got overridden by the ssl config. Nice for testing locally when you don't have ssl setup.

In Laravel 4 they took it out. Why? Fuck knows...

Anyway heres how to get it working again.

  • Step 1