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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Dial timeout="10">555-555-5555</Dial> | |
</Response> |
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
test |
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
$('a').dblclick(function() { | |
$('body').fadeOut("500000"); | |
}); |
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
<div class="postauthor "> | |
<div style="float:left;margin:4px"><?php echo get_avatar( get_the_author_email(), '80' ); ?></div> | |
<h4><?php the_author_posts_link(); ?></h4> | |
<?php the_author_description(); ?> | |
</div> |
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
class User < ActiveRecord::Base | |
acts_as_authentic | |
validates_format_of :username, :with => /\A[\w-]+\Z/ | |
validate :username_is_not_a_route # prevents usernames that are existing routes | |
protected | |
def username_is_not_a_route | |
path = ActionController::Routing::Routes.recognize_path("/#{username}", :method => :get) rescue nil |
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
server { | |
listen 80; | |
server_name stu.mp; | |
# if the request uri was a directory, store the index page name | |
if ($request_uri ~ /$) { | |
set $store_extra index.html; | |
} | |
# proxy module defaults |
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
<?php | |
// list of words to find in string | |
$words = array('barack obama', 'chicago', 'nba'); | |
// string to search | |
$sentence = "Barack Obama is from Chicago. Barack Obama's favorite food it pizza."; | |
$res = array(); // results array |
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
# Lo-fi client for the Facebook API. E.g.: | |
# | |
# fb = FacebookClient.new(:api_key => 'api-key', :secret => 'secret') | |
# fb.call 'users.getInfo', :session_key => 'session-key', :uids => 'user-id', :fields => 'birthday' | |
# | |
# by Scott Raymond <[email protected]> | |
# Public Domain. | |
# | |
class FacebookClient | |
def initialize(default_params={}) |
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
# originally from Joe Stump at Digg | |
for i in `$SVNLOOK changed -t "$TXN" "$REPOS" | /usr/bin/awk '{print $2}'` | |
do | |
if [ ${i##*.} == php ]; then | |
CHECK=`$SVNLOOK cat -t "$TXN" "$REPOS" $i | /usr/bin/php5 -d html_errors=off -l || echo $i` | |
RETURN=`echo $CHECK | /bin/grep "^No syntax" > /dev/null && echo TRUE || echo FALSE` | |
if [ $RETURN = 'FALSE' ]; then | |
echo $CHECK 1>&2; | |
exit 1 |
NewerOlder