Skip to content

Instantly share code, notes, and snippets.

View bobodrone's full-sized avatar

Fredric Bergström bobodrone

View GitHub Profile
@bobodrone
bobodrone / stackbattle.md
Last active March 28, 2023 04:44 — forked from fabsor/stackbattle.md
Stack battle

Stack battle

Feature Django Laravel Winner Comment
Authentication In core In Core Laravel Multiple starter kits available with ready-made toolkits
Authorization In Core In Core Django Django has a built-in permissions system. Laravel has many concepts. Gates, Policies, etc. but requires more code. There's a popular permissions package that adds capabilities to laravel.
Templating system In core In Core Laravel Laravel has the concept of components which is easier to wrap your head around then extending the django templating system.
ORM In core In core Django The django ORM model definition is a lot easier to reason about, and offers automatic migrations. The Laravel query builder is a bit easeier and more SQL-like, but the ORM is really inefficient compared to Django.
Performance Ok Bad Django Laravel requires a lot more work to be performant.
Rest Toolkits DRF jsonapi Django Laravel has
@bobodrone
bobodrone / MODULENAME.install.php
Created September 5, 2020 05:23 — forked from daggerhart/MODULENAME.install.php
Drupal 8 file field to media entities simple migration. Does not move files in filesystem, just creates new media entities.
<?php
/**
* Create media entities from existing file fields.
*
* @link https://chromatichq.com/blog/migrating-drupal-file-fields-media-entities-without-migrate-module
*/
function MODULENAME_update_8001() {
// Nodes types that will get media migrated.
$node_types = ['article','event','page','session','sponsor'];
// Map old file fields => new media fields.

Keybase proof

I hereby claim:

  • I am bobodrone on github.
  • I am bobodrone (https://keybase.io/bobodrone) on keybase.
  • I have a public key ASBxN4UMd7tlAOE6tajZwq8l3_iPijt7DbzpB6eNRccvrwo

To claim this, I am signing this object:

diff --git a/js/references-dialog.js b/js/references-dialog.js
index 0c23b31..fbc5659 100644
--- a/js/references-dialog.js
+++ b/js/references-dialog.js
@@ -1,52 +1,153 @@
(function ($) {
-
var $window = $(window);
-
Drupal.behaviors.referencesDialog = {
booking.controller "BookingController", ($scope, Guests, Resources, Countries, Bookings, Partners, $routeParams, $location, $q, $timeout) ->
$scope.booking = {}
$scope.booking.guests = []
$scope.booking.resources = []
$scope.booking.partners = []
getCountries = ->
d = $q.defer()
Countries.fetch().success (data, status) ->
d.resolve(data)