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 'httparty' | |
require 'json' | |
class Abbot | |
class Configuration | |
attr_accessor :domain, :api_key | |
def initialize | |
@domain = 'http://abbot.monkdev.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
public function copyToMedia($toMediaId) { | |
$ToMedia = MediaMapper::getById($toMediaId); | |
$MediaBackupJob = new MediaBackupJob($ToMedia, | |
$this->getFormat(), | |
$this->getBackupUrl(), | |
$deleteSource = false); | |
$MediaBackupJob->queue(); | |
} |
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
public static function copyByMediaId($mediaId, $toMediaId) { | |
$Medias = self::getByMediaId($mediaId); | |
foreach ($Medias as $Media) { | |
$Media->copyToMediaFormat($toMediaId); | |
} | |
} |
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
public static function getBySiteId($siteId, QueryBuilder3 $CustomQueryBuilder = null) { | |
$QueryBuilder = Database::getQueryBuilder(); | |
$QueryBuilder->select(self::DATABASE . '.' . self::TABLE . '.*') | |
->from(self::DATABASE . '.' . self::TABLE) | |
->where(self::SITE_ID, $siteId); | |
if (isset($CustomQueryBuilder)) { | |
$CustomQueryBuilder->mergeInto($QueryBuilder); | |
} |
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
Install PHP 5.3.x using Brew | |
brew tap josegonzalez/homebrew-php | |
brew install php53 | |
$ sudo /etc/sshd_config | |
PasswordAuthentication yes |
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
class A | |
def a | |
true | |
end | |
end | |
class B | |
def a | |
true | |
end |
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
module B | |
@rara = Array.new | |
end | |
class A | |
include B | |
def show | |
puts @rara | |
end |
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
class Interface | |
def method_missing(method, *args, &block) | |
case method.to_s | |
when 'beaver' | |
throw 'Method missing' | |
end | |
end | |
def acorn |
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
class Campaign < ActiveRecord::Base | |
belongs_to :user | |
#scope :active, where(:active => true) | |
#scope :not_yet_active, where(:active => false) | |
validates :goal, :presence => true | |
validates :url, :presence => true | |
validates :name_or_twitter, :presence => true | |
attr_accessor :complete_tweet |
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
["steventheedge", "RT @stevenbono: I am excited to donate $500 to @ASDFFDSA and you should consider helping me http://t.co/QBOdO4j #mgt20yo", 106769506784915456] | |
{:in_reply_to_status_id=>nil, | |
:favorited=>false, | |
:text=> | |
"RT @stevenbono: I am excited to donate $500 to @ASDFFDSA and you should consider helping me http://t.co/QBOdO4j #mgt20yo", | |
:in_reply_to_status_id_str=>nil, | |
:possibly_sensitive=>false, | |
:geo=>nil, | |
:in_reply_to_screen_name=>nil, | |
:truncated=>false, |