This file contains hidden or 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
/** | |
* Implementation of hook_block(). | |
* | |
* Displays the most recent 10 blog titles. | |
*/ | |
function blog_block($op = 'list', $delta = 0) { global $user; if ($op == 'list') { | |
$block[0]['info'] = t('Recent blog posts'); | |
return $block; | |
} else if ($op == 'view') { | |
if (user_access('access content')) { |
This file contains hidden or 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 'kramdown' | |
module Kramdown::Converter | |
class Html | |
def convert_a(el, indent) | |
res = inner(el, indent) | |
attr = el.attr.dup | |
if attr['href'] =~ /^mailto:/ | |
attr['href'] = obfuscate('mailto') << ":" << obfuscate(attr['href'].sub(/^mailto:/, '')) | |
res = obfuscate(res) |
This file contains hidden or 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/env python | |
""" | |
A simple script that extracts transcripts from <http://www.ted.com> | |
HOWTO: | |
python ted_tracscript_extractor.py john_hodgman_s_brief_digression.html | |
or | |
This file contains hidden or 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
import sys | |
import socket | |
HOST, PORT = "127.0.0.1", 9999 | |
data = " ".join(sys.argv[1:]) | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect((HOST, PORT)) | |
sock.send(data + "\n") |
This file contains hidden or 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 | |
# Notice the '-d' | |
if [ -d ~/.bin-private ]; then | |
echo "Your private bin exists." | |
else | |
echo "Your private bin doesn't exists." | |
fi | |
# Notice the '-f' |
This file contains hidden or 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
$ umount /var | |
$ lvresize -L +5GB /dev/mapper/RoundTable00-Knight04 # this will resize the LVM 5GBs bigger | |
$ e2fsck -f /dev/mapper/RoundTable00-Knight04 # this check to make sure there isn't any issues with the partition | |
$ resize2fs /dev/mapper/RoundTable00-Knight04 7G # this will resize the mount point | |
$ mount /var |
This file contains hidden or 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/env python | |
""" | |
A simple script that downloads the first page wallpapers from Simple | |
Desktops <http://simpledesktops.com/browse/>. | |
Copyright (c) 2010, Myles Braithwaite <[email protected]> | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions |
This file contains hidden or 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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<!-- | |
SlickMap CSS | |
Version 1.2 | |
2010-05-05 | |
Created by Matt Everson of Astuteo, LLC | |
- http://astuteo.com/slickmap |
This file contains hidden or 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/env python | |
# encoding: utf-8 | |
# Copyright (c) 2009 Greg Newman | |
# Copyright (c) 2010 Myles Braithwaite | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, |
This file contains hidden or 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/sh | |
# | |
# A simple shell script to check into a venue in Foursquare. | |
CURL=`which curl` | |
FOURSQUARE_API="http://api.foursquare.com/v1/checkin" | |
if test -z "$CURL"; then | |
echo "curl binary not found" | |
exit 1 |