Skip to content

Instantly share code, notes, and snippets.

View tjnine's full-sized avatar

TJ Nine tjnine

View GitHub Profile
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@tjnine
tjnine / Blade-2-HTML-Minify
Created October 14, 2015 14:34
Use Gulp to convery Blade templates to minified HTML
I recommend using Gulp, instead of a PHP package, to compress the HTML that gets generated by your Blade template files. It works very well and is very configurable. It uses [gulp-htmlmin](https://github.com/jonschlinkert/gulp-htmlmin), which uses [html-minifier](https://github.com/kangax/html-minifier).
### Create a new task in your `gulpfile.js`
```javascript
var htmlmin = require('gulp-htmlmin');
var gulp = require('gulp');
gulp.task('compress', function() {
var opts = {
*This post is also on [my blog](http://www.samselikoff.com/blog/preparing-for-ember-2.0/), since Gist doesn't support @ notifications.*
---
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use `Ember.Controller` instead of `Ember.ArrayController` or `Ember.ObjectController`
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an `Ember.Controller`, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@tjnine
tjnine / gist:76d94df22fb4596c6652
Created March 3, 2015 19:27
Creat SQLite 3 Database
#!/usr/bin/php
<?php
if (!$argc) die('This file is not viewable from the web');
$pdo = new PDO('sqlite:' . __DIR__ . '/registry.sq3');
$query = 'create table if not exists registrants(first TEXT, last TEXT, registered_timestamp INTEGER);';
$success = $pdo->exec($query);
if ($success !== false) {
print "Database create command executed successfully\n";
} else {
sprintf(

Using phpMyAdmin with Homestead box

Once the Homestead vagrant box is installed successfully, we can add phpMyAdmin and config it to run with Nginx.

Install phpMyAdmin

  • SSH into Homestead vagrant box with vagrant ssh and type the following command:
    sudo apt-get install phpmyadmin