Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| function safemode() { // jacked from Syrian Shell | |
| $safe_mode = ini_get("safe_mode"); | |
| if (!$safe_mode) { | |
| $safe_mode = 'off'; | |
| } | |
| else { | |
| $safe_mode = 'on'; // ...fuck | |
| } | |
| return $safe_mode; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| require 'yaml' | |
| require 'active_record' | |
| require 'active_record/connection_adapters/mysql_adapter' | |
| class MysqlRaw | |
| attr_accessor :connection | |
| def initialize | |
| @config = YAML::load(File.open("#{Rails.root}/config/database.yml"))["mysql_#{Rails.env}"] | |
| @connection = ActiveRecord::Base.mysql_connection(@config) |