Skip to content

Instantly share code, notes, and snippets.

View artlung's full-sized avatar
💭
🤖

Joe Crawford artlung

💭
🤖
View GitHub Profile
@artlung
artlung / StructToQueryString.cfm
Created October 11, 2010 14:22
StructToQueryString() ColdFusion
<!---
<cfset submit_URL = StructNew()>
<cfset submit_URL.something = 1>
<cfset submit_URL.something2 = 2>
<cfset submit_URL.other = "hello world">
<cfoutput>
#StructToQueryString(Submit_URL)#
</cfoutput>
@cowboy
cowboy / HEY-YOU.md
Last active October 25, 2024 15:29
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@njh
njh / musicbrainz-twitter.sql
Created September 8, 2011 21:31
Twitter accounts in MusicBrainz
COPY (SELECT artist.gid, artist_name.name, url.url FROM url
JOIN l_artist_url ON (url.id = l_artist_url.entity1)
JOIN artist ON (artist.id = l_artist_url.entity0)
JOIN artist_name ON (artist_name.id = artist.name)
WHERE url LIKE '%twitter.com%') TO STDOUT WITH CSV;
891abb2e-0156-411b-bf60-f4104e71ddfa,SMiLE.dk,http://twitter.com/smiledkmusic
aead4c74-d7e1-4960-8cec-bacb86617924,Triobelisk,http://twitter.com/triobelisk
89bf7e7f-34ef-4d91-a4f2-4f2bfe8c5c67,Freeze The Atlantic,http://twitter.com/fta_band
@boogah
boogah / WordPress_Unicode_Fix.sql
Last active October 14, 2016 08:11
Run this when you see weird crap in your posts/comments after moving your WordPress install.
update wp_posts set post_content = replace(post_content,'’','\'');
update wp_posts set post_title = replace(post_title,'’','\'');
update wp_comments set comment_content = replace(comment_content,'’','\'');
update wp_postmeta set meta_value = replace(meta_value,'’','\'');
update wp_posts set post_excerpt = replace(post_excerpt,'’','\'');
update wp_posts set post_content = replace(post_content,'…','...');
update wp_posts set post_title = replace(post_title,'…','...');
update wp_comments set comment_content = replace(comment_content,'…','...');
update wp_postmeta set meta_value = replace(meta_value,'…','...');
@JeffreyWay
JeffreyWay / gist:1525217
Created December 27, 2011 21:29
Instant Server for Current Directory
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@alexkingorg
alexkingorg / wp-editor-char-count.php
Created January 16, 2012 18:43
Character counter for WordPress editor
<?php
// handy if you write status posts and send them to Twitter
function akv3_editor_char_count() {
?>
<script type="text/javascript">
(function($) {
wpCharCount = function(txt) {
$('.char-count').html("" + txt.length);
@boogah
boogah / changelog.md
Last active April 6, 2021 14:25
DMCA Takedown Template Originally adapted from: http://www.epicorg.com/sample-dmca-take-down-notice.html
@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000