The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
| SELECT | |
| table_schema as `Database`, | |
| table_name AS `Table`, | |
| round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
| FROM information_schema.TABLES | |
| ORDER BY (data_length + index_length) DESC; |
| <? | |
| /* | |
| I am using route caching that prevents me from using closures, but even then I don't see why I can't choose to pass static information to a controller without using route parameters. | |
| For example, My project has an umber of redirects in it, and rather than loading up 40 domains with redirect DNS entries that only I have access to. | |
| I have a helper controller to do this so that my team may make entries. | |
| I am running 40 unique sites out of one Laravel instance to keep my maintenance low. 40 sites x about 25 redirects is a lot of DNS entries. | |
| */ |
| gulp.task('cacheBuster', function(cb){ | |
| //new Date().getTime() | |
| fs.writeFile('config/cacheBuster.php', '<?php return ' + new Date().getTime() + ';', cb); | |
| }); |
| # /app/Exceptions/Handler.php | |
| # use Symfony\Component\Debug\Exception\FlattenException; | |
| # public function render($request, Exception $e) | |
| $exception = FlattenException::create($e); | |
| $statusCode = $exception->getStatusCode($exception); | |
| if ($statusCode === 404 or $statusCode === 500 and app()->environment() == 'production') { |
| $this->app['request']->server->set('HTTPS', $this->app->environment() != 'local'); |
| <? $data = get_fields();?> | |
| <script> | |
| console.log(<?= json_encode($data) ?>) | |
| </script> |
| <IfModule mod_mime.c> | |
| # Audio | |
| AddType audio/mp4 m4a f4a f4b | |
| AddType audio/ogg oga ogg | |
| # JavaScript | |
| # Normalize to standard type (it's sniffed in IE anyways): | |
| # http://tools.ietf.org/html/rfc4329#section-7.2 | |
| AddType application/javascript js |
| (function($) { | |
| var o = $( {} ); | |
| $.each({ | |
| trigger: 'publish', | |
| on: 'subscribe', | |
| off: 'unsubscribe' | |
| }, function( key, val ) { | |
| jQuery[val] = function() { | |
| o[key].apply( o, arguments ); |
| <? | |
| if ( have_posts() ): | |
| echo '<!-- '.$post->post_name.'-->'; | |
| if ( is_front_page() ): | |
| get_template_part('templates/content', 'home'); | |
| else: | |
| if ( file_exists(get_template_directory().'/templates/content-'.$post->post_name.'.php')) | |
| get_template_part('templates/content', $post->post_name); | |
| else | |
| get_template_part('templates/content', 'page'); |