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
<?php | |
class item { | |
public $player_id, $ids, $sql, $vars = array(); | |
private $functions = array(); | |
function __construct($sql=null) { | |
$this->sql = $sql; | |
$this->sql->query('SHOW FIELDS FROM items'); | |
for($x=0;$x<$this->sql->rows;$x++) { | |
$this->sql->fetch($x); |
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 'bcrypt' | |
require 'securerandom' | |
class User | |
include DataMapper::Resource | |
include BCrypt | |
property :id, Serial | |
property :email, String, :required => true, :index => :login, :unique => true, :format => :email_address | |
property :password_hash, Text, :required => true, :index => :login, :writer => :protected |
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
MacBook-Pro:local daniel$ brew install imagemagick | |
/usr/local/bin/git | |
==> Cloning https://github.com/adamv/ImageMagick.git | |
Updating /Users/daniel/Library/Caches/Homebrew/imagemagick--git | |
==> Checking out tag 6.6.9-4 | |
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.6.9-4 --disable-dependency-tracking - | |
==> make install | |
/bin/sh ./config/mkinstalldirs . ltdl/ | |
cp ./ltdl/argz_.h ltdl/argz.h-t | |
mv ltdl/argz.h-t ltdl/argz.h |
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
Building native extensions. This could take a while... | |
ERROR: Error installing rmagick: | |
ERROR: Failed to build gem native extension. | |
/Users/daniel/.rvm/rubies/ruby-1.8.7-p352/bin/ruby extconf.rb -with-Magiclib=/usr/local/Cellar/imagemagick/6.7.1-1/lib | |
checking for Ruby version >= 1.8.5... yes | |
checking for gcc... yes | |
checking for Magick-config... yes | |
checking for ImageMagick version >= 6.4.9... yes | |
checking for HDRI disabled version of ImageMagick... 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
==> make install | |
make install | |
/bin/sh ./config/mkinstalldirs . ltdl/ | |
cp ./ltdl/argz_.h ltdl/argz.h-t | |
mv ltdl/argz.h-t ltdl/argz.h | |
make install-am | |
CC ltdl/argz.lo | |
CC coders/coders_art_la-art.lo | |
CC coders/coders_avs_la-avs.lo | |
CC coders/coders_bgr_la-bgr.lo |
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
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.1-1 --enable-shared --disable-stat | |
==> make install | |
/bin/sh ./config/mkinstalldirs . ltdl/ | |
cp ./ltdl/argz_.h ltdl/argz.h-t | |
mv ltdl/argz.h-t ltdl/argz.h | |
make install-am | |
CC ltdl/loaders/dlopen.lo | |
CC ltdl/argz.lo | |
CC coders/coders_art_la-art.lo | |
CC coders/coders_avs_la-avs.lo |
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 Mailbox | |
include DataMapper::Resource | |
property :id, Serial | |
property :title, String, :required => true, :length => 1..30 | |
property :message, Text, :required => true, :length => 1..3000 | |
property :date_sent, DateTime, :default => proc { DateTime.now } | |
belongs_to :to, 'Player' | |
belongs_to :from, 'Player' |
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 'bcrypt' | |
require 'securerandom' | |
class User | |
include DataMapper::Resource | |
include BCrypt | |
property :id, Serial | |
property :email, String, :required => true, :index => :login, :unique => true, :unique_index => true, :format => :email_address | |
property :password_hash, Text, :required => true, :index => :login |
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 'redis' | |
# Easily use Redis anywhere from controllers, views, and more importantly models. | |
class RedisCache | |
def initialize | |
@redis = Redis.new(:host => "127.0.0.1", :port => 15501, :password => "password", :db => 1) | |
end | |
def method_missing(id, *args, &block) |
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
# Disable :layout for any ajax request | |
# (easily allows you to support browsers with/without JS) | |
# Same concept can be applied to render, erb, etc. | |
module Sinatra | |
class Base | |
def haml(template, options={}); options.merge!(:layout => false) if request.xhr?; super; end | |
end | |
end |
OlderNewer