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
# Copyright (c) 2010, Diaspora Inc. This file is | |
# licensed under the Affero General Public License version 3 or later. See | |
# the COPYRIGHT file. | |
class Service | |
include MongoMapper::Document | |
include ActionView::Helpers::TextHelper | |
belongs_to :user |
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 Services::Twitter < Service | |
MAX_CHARACTERS = 140 | |
def post(post, url='') | |
Rails.logger.debug("event=post_to_service type=twitter sender_id=#{self.user_id}") | |
message = public_message(post, url) | |
twitter_key = SERVICES['twitter']['consumer_key'] | |
twitter_consumer_secret = SERVICES['twitter']['consumer_secret'] |
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 'RMagick' | |
class CropToelie | |
include Magick | |
attr_accessor :image | |
attr_accessor :width | |
attr_accessor :height | |
attr_accessor :step_size | |
def initialize image_path |
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 | |
/* | |
Plugin Name: WP-TweetButton | |
Version: 1.7.5 | |
Description: Automatically adds the new Official Twitter Tweet Button to your Blog.Easily Customizable from the Dashboard(with Tweet Syntax, hash tags and much more.). | |
Author: CoderPlus | |
Author URI: http://coderplus.com | |
Plugin URI: http://coderplus.com/2010/08/twitter-tweet-button-plugin-for-wordpress/ | |
wp-tweetbutton | |
*/ |
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 | |
/** | |
* Usage | |
* $inconsistent_view_thingy = views_get_view("some_view_name"); | |
* $more_inconsistent_view_thingy = rand_obj_or_array($inconsistent_view_thingy); | |
*/ | |
function rand_obj_or_array($thing) { | |
$det = rand(0,2); |
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
if (isset($weather_data[$column]) && $weather_data[$column] && isset($mapping[$weather_data[$column]]) && $mapping[$weather_data[$column]]) { | |
if (isset($field['weatherfield_settings']['cs'][$column]['s'][$mid]['g']['options_files'][$mapping[$weather_data[$column]]]) && isset($field['weatherfield_settings']['cs'][$column]['s'][$mid]['g']['options_files'][$mapping[$weather_data[$column]]]['fid'])) { | |
if (isset($files[$field['field_name']][$field['weatherfield_settings']['cs'][$column]['s'][$mid]['g']['options_files'][$mapping[$weather_data[$column]]]['fid']])) { | |
$column_output = theme('image', $files[$field['field_name']][$field['weatherfield_settings']['cs'][$column]['s'][$mid]['g']['options_files'][$mapping[$weather_data[$column]]]['fid']]->filepath); | |
} | |
} | |
} |
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 id="block-views-news-block_3" class="block block-views first region-odd odd region-count-1 count-9 with-block-editing"> | |
<div class="content"> | |
<div class="views_view view view-news view-id-news view-display-id-block_3 view-dom-id-3"> | |
<div class="views-admin-links views-hide"> |
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
.page-CENSORED #edit-somefield-wrapper label { | |
background: url(../images/required.gif) 40px top no-repeat; | |
} | |
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
$client = new SoapClient($cad_url); | |
$count = count($args); | |
if ($count == 0) { | |
$response = $client->$method(); | |
} | |
elseif ($count == 1) { | |
$response = $client->$method($args[0]); | |
} | |
elseif ($count == 2) { | |
$response = $client->$method($args[0], $args[1]); |
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
1) SomeBarsController GET 'index' should be successful | |
Failure/Error: get 'index' | |
ActionController::RoutingError: | |
No route matches {:controller=>"some_bars"} | |
2) SomeBarsController GET 'index' should render Hello World | |
Failure/Error: get 'index' | |
ActionController::RoutingError: | |
No route matches {:controller=>"some_bars"} |