Skip to content

Instantly share code, notes, and snippets.

@tylerflint
tylerflint / gist:891475
Created March 28, 2011 22:48
example root directory
web:
document_root: /app
@tylerflint
tylerflint / gist:891491
Created March 28, 2011 22:56
example default gateway
web:
default_gateway: bootstrap.php
@tylerflint
tylerflint / gist:891509
Created March 28, 2011 23:05
writable storage example
general:
writable_directories: [/media, /var/log]
@tylerflint
tylerflint / gist:891517
Created March 28, 2011 23:09
custom error pages
web:
error_pages:
404: /404.html
502: /502.html
@tylerflint
tylerflint / gist:892781
Created March 29, 2011 17:10
permissions example
permissions:
/admin :
- 127.0.0.1: allow
- all: deny
/test/phone-list.txt :
- 123.5.15.8: deny
- 123.5.15.9: deny
- 123.5.15.10: deny
- 123.5.15.11: deny
- 123.5.15.12: deny
# views/shared/_simple_list_container.html.erb
<div class="content company">
<ul class="list <%= p.object_label_plural.downcase %>">
<li class="first search" title="Search <%= p.object_label_plural.capitalize %> List"><span class="admin-sprite icon"></span><input id="search-filter" value="Search <%= p.object_label_plural.capitalize %>" onfocus="if(this.value=='Search <%= p.object_label_plural.capitalize %>')value=''" onblur="if(this.value=='')this.value='Search <%= p.object_label_plural.capitalize %>'"/>
<div class='actions-bar'>
<a href="<%= url_for [:new, :admin, @company, p.object] %>" title="Add New <%= p.object_label_plural %>" class="sprite add"></a>
<a href="#link" title="Enables [Item] Removal" class="sprite remove" onclick="toggleRemove()"></a>
</div>
</li>
@tylerflint
tylerflint / gist:957578
Created May 5, 2011 18:20
exec functionality
def spawn(command)
fork do
File.umask self.umask if self.umask
uid_num = Etc.getpwnam(self.uid).uid if self.uid
gid_num = Etc.getgrnam(self.gid).gid if self.gid
::Dir.chroot(self.chroot) if self.chroot
::Process.setsid
::Process.groups = [gid_num] if self.gid
::Process::Sys.setgid(gid_num) if self.gid
@tylerflint
tylerflint / gist:970899
Created May 13, 2011 17:04
cake .box file
document_root: /app/webroot
network_writable_dirs:
- app/tmp
php_extensions:
- mcrypt
- mysqli
- mbstring
@tylerflint
tylerflint / gist:1004808
Created June 2, 2011 17:01
enhanced rewrites
url_rewrites:
- ^/location_a.php /location_b.php
-
rule: ^/location_a.php /location_b.php
conditions:
- one
- two
-
rule: ^/location_a.php /location_b.php
conditions:
@tylerflint
tylerflint / gist:1004883
Created June 2, 2011 17:44
cakephp .box file
document_root: /app/webroot
shared_writable_dirs:
- app/tmp
- tmp/cache
php_extensions:
- mcrypt
- mysqli
- mbstring