Skip to content

Instantly share code, notes, and snippets.

@llimllib
llimllib / mssql_to_csv.bash
Last active April 15, 2024 16:00
This is a script to convert every table in a Microsoft SQL Server database backup (.bak file) to a .csv file
#!/usr/bin/env bash
# import an MS SQL .bak backup file to an MS SQL database, then export all
# tables to csv. run this script as `import.sh <filename>`. It expects to be
# run in the same directory as the backup file.
# this is only tested on my mac (OS X Catalina). I tried to stick to posix, but
# It will probably require some tweaking for you. I hope it gives a general
# sense of what you need to do at the very least.
@cstrouse
cstrouse / gist:4520209
Created January 12, 2013 19:55
Wordpress shortcode to grab all archived newsletters from a Constant Contact archive page and output as a table. To use add the require statement and the shortcode function to your theme's functions.php, upload the simple_html_dom.php file to the theme directory (you can get it from sf.net) and then replace the Constant Contact archive link with…
<?php require('simple_html_dom.php');
function generate_newsletter_archives($atts, $content = null) {
// setup the beginning of our data table for archives
$out = '<table cellpadding="0" cellspacing="0" id="newsletter-archives"><tr><th>Resource</th><th>Date</th></tr><tbody>';
// fetch the page which contains all of the newsletter issues that have been archived
$archive_page = str_get_html(wp_remote_retrieve_body(wp_remote_get('http://archive.constantcontact.com/fs127/1103640951068/archive/1111407854121.html')));