We will install Larave 4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.
apt-get update && apt-get upgrade
adduser [username]
usermod -aG sudo [username]
apt-get -y install git
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel 5, Bootstrap 4 Pagination | |
|-------------------------------------------------------------------------- | |
| | |
| A partial view to handle pagination for collections in Laravel's query | |
| builder or Eloquent ORM, styled with Bootstrap 4. | |
| | |
| The pagination displays like the following, where * denotes the current |
<?php | |
// Your/Ext/controllers/Checkout/CartController.php | |
class Your_Ext_Checkout_CartController extends Mage_Checkout_CartController | |
{ | |
public function yourNewAction() | |
{ | |
} | |
} |
namespace :deploy do | |
namespace :assets do | |
Rake::Task['deploy:assets:precompile'].clear_actions | |
desc "Precompile assets on local machine and upload them to the server." | |
task :precompile do | |
run_locally do | |
execute 'RAILS_ENV=production bundle exec rake assets:precompile' | |
end |
#!/bin/bash | |
# | |
# Restart Bluetooth Module on Mac OS X | |
# | |
# Requires Blueutil to be installed: http://brewformulas.org/blueutil | |
BT="/usr/local/bin/blueutil" | |
log() { | |
echo "$@" |
If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.
Rack describes itself as follows:
Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.
Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.
At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> |
<!DOCTYPE html> | |
<head> | |
<title>Stay Standalone</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<script src="stay_standalone.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<ul> | |
<li><a href="http://google.com/">Remote Link (Google)</a></li> |