Skip to content

Instantly share code, notes, and snippets.

@msenateatplos
msenateatplos / membership.txt
Created September 18, 2013 18:11
sudo room members list
name,email,username,handle,membership rate
Matt Senate,[email protected],mattsenate,$10/week
Marina Kukso,[email protected],marina,mk30,$?/week
Marc Juul,[email protected],juul,$?/month
Jenny Ryan,[email protected],jenny,tunabananas,$?/week
@msenateatplos
msenateatplos / permalink_filter.php
Created September 6, 2013 18:39
a couple little filter snippets to expose some ppt permalinks, not quite desirable functionality yet
@msenateatplos
msenateatplos / all-urls-all-sites.php
Created August 23, 2013 00:31
Script to display all post links for all blogs on a WordPress multi-site installation. Place in `wp-content/` then browse to http://yourblogdomain.com/wp-content/all-urls-all-sites.php or use as a script. Use `&post_type=article`, `&post_status=publish` and various other options with `query_posts()`
<?php
require_once('../wp-blog-header.php');
$blog_list = get_blog_list( 0, 'all' );
foreach ($blog_list AS $blog) {
switch_to_blog($blog['blog_id']);
@msenateatplos
msenateatplos / copyleft_all_wrongs_reversed
Created June 29, 2013 10:03
Little javascript footer for informal rejection of copyright, as copyleft. Not a license, but a disclaimer, read more at: http://web.archive.org/web/20080101091757/http://www.iusmentis.com/copyright/allrightsreserved/ Replace $YOUR_NAME with the proper name for attribution, and $YOUR_URL with the proper URL for attribution.
<p><!--[if lte IE 8]><span style="filter: FlipH; -ms-filter: "FlipH"; display: inline-block;"><![endif]--><span style="-moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); display: inline-block;">©</span><!--[if lte IE 8]></span><![endif]--> CopyLeft <a href="$YOUR_URL"><abbr>$YOUR_NAME</abbr></a>, All Wrongs Reversed, <script type="text/javascript">var d = new Date(); var year = d.getFullYear(); document.write(year);</script>.</p>
@msenateatplos
msenateatplos / corporate_open_source_anti-patterns.txt
Created May 29, 2013 00:30
Notes on Bryan Cantrill's talk on Corporate Open Source Anti-Patterns
Found this very interesting talk by Bryan Cantrill https://en.wikipedia.org/wiki/Bryan_Cantrill on Corporate Open Source Anti-Patterns: Doing It Wrong (youtube https://www.youtube.com/watch?v=NhgXQFk9noI & slides http://www.slideshare.net/bcantrill/corporate-open-source-antipatterns). His slides are verbose, a little rough, and hard to understand, so I took some notes and made a summary, trying to simplify:
Side-note - He pushes a few debatable viewpoints (common flamebait such as GPL vs other licenses), so take these phrasings with a grain of salt (wink)
Summary
Inverted Thinking:
Misconception that the benefits of open source are assumed to be primary ($). In actuality, benefits are typically secondary, tertiary, and one should consider the cost of sharing is pretty much $0.
Wishful Thinking:
#!/bin/bash
# Script to download, configure, and install Ubuntu as a Xen domU
# Uses existing LVM Volume Group. Must be run as root/sudo.
# Based on instructions at https://help.ubuntu.com/community/Xen
# User Configurable Settings
NAME=ubuntu # name of Domain to create
VG=/dev/domU # existing volume group in which to create a logical volume
LV=$NAME # name of the new logical volume to create
LV_SIZE=5G # size of the new logical volume
@msenateatplos
msenateatplos / styleIE7.css
Created April 4, 2013 23:29
Works around problem with Hum WordPress theme in IE7 (can help IE6 too), copies responsive styles to a separate stylesheet, which can be included only if IE7 (or IE6) is used. Posted here: http://wordpress.org/support/topic/header-logo-and-menu-ie7-layout?replies=2#post-4054505
/**
* Attempts to solve a problem with IE7 and Hum theme
* described here: http://wordpress.org/support/topic/ie7
*/
#site-title a {
font-size: 3.6em;
}
#main {
@msenateatplos
msenateatplos / email.php
Last active December 15, 2015 09:39
Updated to WYSIJA Version 2.5, edits wysija-newsletters/controllers/front/email.php to allow only logged in users to see HTML version of newsletter.
<?php
defined('WYSIJA') or die('Restricted access');
include_once( ABSPATH . "wp-includes/pluggable.php");
global $current_user;
class WYSIJA_control_front_email extends WYSIJA_control_front{
var $model='email';
var $view='email';
@msenateatplos
msenateatplos / test2.pys.out
Created March 13, 2013 19:18
An uncompressed (bzip2) version of a .pys test file for pyspread. Corresponds to https://github.com/manns/pyspread/issues/43 I downloaded this data set http://archive.ics.uci.edu/ml/machine-learning-databases/00229/Skin_NonSkin.txt and imported it into one cell, then squared it in a different cell, then finally, wrote the output to another file …
[Pyspread save file version]
0.1
[shape]
1000 100 3
[grid]
7 5 0 abc_to_the_abc
13 11 0 abc_to_the_abc
11 2 0 two = skindata[245000]
9 2 0 skindata[1]
10 3 0 one * two
@msenateatplos
msenateatplos / multi-twitter-widget.patch
Created September 21, 2012 22:46
Patch to improve multi-twitter-widget for wordpress
http://wordpress.org/extend/plugins/multi-twitter-widget/
I needed to display the twitter stream for several accounts, as well as display an account with the results of a search query. This plugin seemed to do the trick, but there were a couple of bugs, so I tweaked it a bit, the code is below. My patch includes:
<ul>
<li>Improvement to the `$tweet preg_replace` to add proper links for account tweets</li>
<li>A "multi-twitter" css class to `<ul>` for customized styling</li>
<li>Renamed indeces and loop used in "// Split array and output results" to avoid confusion / naming conflict. Also improved formatting by making screenname and search result tweets consistent in display.
<li>Fixed display of human_time for search results</li>
</ul>