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 | |
| // Establish search query | |
| $search = ORM::factory('blog'); | |
| // Get search total | |
| $total = $search->reset(FALSE)->count_all(); | |
| // Create pagination | |
| $pagination = Pagination::factory(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
| <?php | |
| /** | |
| * Check for form submission with a csrf check | |
| */ | |
| private function __form_submission() | |
| { | |
| if ($post = Input::post()) | |
| { | |
| $token = Arr::get($post, 'csrf'); |
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
| #!/usr/bin/php | |
| <?php | |
| // See if we even need to run this file | |
| $modified_files = shell_exec("git st"); | |
| if (strpos($modified_files, '.js') === FALSE AND strpos($modified_files, '.css') === FALSE) die("/ Skipping minification.\n"); | |
| // Find the config files to minify | |
| $search = shell_exec("find . -name min.config.xml"); | |
| $config_files = explode("\n", $search); |
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
| # Install linux update, followed by GCC and Make | |
| sudo yum -y update | |
| sudo yum install -y gcc make | |
| # Install Nginx and PHP-FPM | |
| sudo yum install -y nginx php-fpm | |
| # Install PHP extensions | |
| sudo yum install -y php-devel php-mysql php-pdo \ | |
| php-pear php-mbstring php-cli php-odbc \ |
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
| # Build tools | |
| sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
| # Install python 2.7 and change default python symlink | |
| sudo yum install python27-devel -y | |
| sudo rm /usr/bin/python | |
| sudo ln -s /usr/bin/python2.7 /usr/bin/python | |
| # yum still needs 2.6, so write it in and backup script | |
| sudo cp /usr/bin/yum /usr/bin/_yum_before_27 |
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
| #!/bin/sh | |
| # | |
| # nginx - this script starts and stops the nginx daemin and includes chkconfig | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
| # proxy and IMAP/POP3 proxy server | |
| # processname: nginx | |
| # config: /opt/nginx/conf/nginx.conf | |
| # pidfile: /opt/nginx/logs/nginx.pid |
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
| # Install wp-cli.org | |
| # Use: bash -c "$(curl -fsSL https://gist.githubusercontent.com/jylinman/f14885421729a77153f6/raw/wp-install.sh)" | |
| echo "Database name: " | |
| read db_name | |
| echo "Database username: " | |
| read db_user | |
| echo "Database password: " | |
| read db_pass | |
| echo "Database host: " |
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
| namespace :figaro do | |
| desc "SCP transfer figaro configuration to the shared folder" | |
| task :setup do | |
| on roles(:app) do | |
| upload! "config/application.yml", "#{shared_path}/config/application.yml", via: :scp | |
| end | |
| end | |
| desc "Symlink application.yml to the release path" | |
| task :symlink do |
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
| # Add this to top of schedule.rb | |
| env :PATH, ENV['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
| def flatten_hash hash | |
| hash.each_with_object({}) do |(k, v), h| | |
| if v.is_a? Hash | |
| flatten_hash(v).map do |h_k, h_v| | |
| h["#{h_k}"] = h_v | |
| end | |
| else | |
| h[k] = v | |
| end | |
| end |
OlderNewer