Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
# install ThinkUp on EC2 Ubuntu instance: | |
# | |
# @spara 12/23/10 | |
# @waxpancake 1/3/11 | |
# install required packages | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# credit: http://news.ycombinator.com/item?id=1543915 | |
# in ipythonrc: | |
# execfile copy_and_paste.py | |
def copy(data): | |
from subprocess import Popen, PIPE | |
Popen(["xclip", "-selection", "clipboard"], stdin=PIPE).communicate(str(data)) | |
def paste(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createExcerpt(str,maxwords){ | |
if(str) { | |
var excerpt = ''; | |
var words_arr = []; | |
str = str.replace(/^\s+|\s+$/g,""); //trims spaces from start and end of string | |
str = stripTags(str); | |
words_arr=str.split(' '); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Activity widget</title> | |
<style type="text/css"> | |
body { font-family: Helvetica; font-size: 12px; } | |
#note-list li { list-style: none; margin-bottom: 5px; padding-bottom: 5px; border-bottom: 1px dotted #999; } | |
#note-list li span.avatar { padding-right: 10px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Activity widget</title> | |
</head> | |
<body> | |
<ul id="note-list"></ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require WWW::Instapaper::Client; | |
my $paper = WWW::Instapaper::Client->new( | |
username => 'hellotypepad@mac.com', # E-mail OR username | |
password => '', | |
); | |
my $result = $paper->add( | |
url => 'http://hello.typepad.com/hello/2010/04/hbos-treme-creator-david-simon-explains-it-all-for-you.html', | |
title => "Treme Story", # optional, will try to get automatically if not given |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h3>External Assets Example</h3> | |
<?php | |
/***** Utility methods + constants ******/ | |
define ("DEFAULT_DEBUG_MODE", 1); | |
define ("ROOT_TYPEPAD_API_URL", "http://api.typepad.com"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use IO::Prompt; | |
use Try::Tiny; | |
use WWW::TypePad; | |
use WWW::TypePad::CmdLine; | |
my $tp = WWW::TypePad::CmdLine->initialize( requires_auth => 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bobcousy@bobcousyslisp.com [~/public_html]# cat .htaccess | |
AddHandler fastcgi-script .fcgi | |
# rewrite url request enabled | |
RewriteEngine On | |
# if the FILENAME requested isn't an actual file, perform the next command | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# send requested urn to the dispatch.fcgi to be processed | |
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L] |