Skip to content

Instantly share code, notes, and snippets.

@robcolburn
robcolburn / custom-tweetbox.html
Created May 31, 2012 16:51
How to make custom tweetboxes
<div>
<h1>Tweetbox</h1>
<form id="my-tweetbox">
<p><textarea name="tweet">Write your tweet...</textarea></p>
<p><input type="submit" name="submit" value="Tweet!" /></p>
</form>
</div>
<div>
<h1>County Tweetbox</h1>
<a href="javascript:foo()">foo</a>
<script>
function foo() {
function allDone () {
return 'sweet, declaration at the beginning.'
}
'set a break here';
'check out the scope variables';
@robcolburn
robcolburn / getQuery.js
Created May 3, 2012 20:11
Parse query string parameters
function getQuery(s) {
var query = {}, i = s.indexOf('?');
if (i != -1) {
s.substr(i+1).replace(/\+/g, ' ').replace(/([^&;=]+)=?([^&;]*)/g, function (m, k, v) {
query[decodeURIComponent(k)] = decodeURIComponent(v);
});
}
return query;
}
//_GET = getQuery(location.href);