Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
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
| // Using this code, we can retrieve an image from a user's filesystem, resize the image, and then upload the image | |
| // to a server using AJAX. Because we use base64 encoding, we can just include the image data as just another string value | |
| // in a JSON payload. | |
| // So we can use AJAX to send the file to a server, which is convenient. | |
| // We have one line of relevant html | |
| // get file in the first place => <input type="file" custom-on-change="onAcqImageFileChange" class="form-control"> |
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 | |
| /** | |
| * This serves as an example of how to use the Google API PHP Client | |
| * with Firebase Cloud Messaging Service. | |
| * | |
| * The client can be found here: | |
| * https://github.com/google/google-api-php-client | |
| * | |
| * At the time of writing this, there's no Service object for the correct |
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
| angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers']) | |
| .run(function(DB) { | |
| DB.init(); | |
| }); |
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
| sudo apachectl stop | |
| sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null |
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
| // Vanilla version of FitVids | |
| // Still licencened under WTFPL | |
| // | |
| // Not as robust and fault tolerant as the jQuery version. | |
| // It's BYOCSS. | |
| // And also, I don't support this at all whatsoever. | |
| ;(function(window, document, undefined) { | |
| 'use strict'; | |
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
| angular | |
| .module('uuidApp', ['lvl.services']) | |
| .controller('uuidCtl', ['$scope', 'uuid', function($scope, uuid){ | |
| $scope.generateUuid = function() { | |
| $scope.new = uuid.new(); | |
| $scope.nInfo = new Date(); | |
| }; | |
| $scope.showEmpty = function() { | |
| $scope.empty = uuid.empty(); |
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/env node | |
| // this file lives at hooks/after_prepare/010_resource_files.js | |
| // It copies my icon and splash screens to the correct location | |
| // so that they will be loaded by Cordova 3.5 | |
| // | |
| // This hook copies various resource files | |
| // from our version control system directories | |
| // into the appropriate platform specific location |
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 | |
| namespace App\Jobs; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Queue\SerializesModels; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Contracts\Queue\ShouldQueue; | |
| use Mailchimp; |
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
| /* http://twitter.github.com/bootstrap/scaffolding.html#responsive */ | |
| /* Landscape phones and down */ | |
| @media (max-width: 480px) { ... } | |
| /* Landscape phone to portrait tablet */ | |
| @media (max-width: 768px) { ... } | |
| /* Portrait tablet to landscape and desktop */ | |
| @media (min-width: 768px) and (max-width: 940px) { ... } |
NewerOlder