Skip to content

Instantly share code, notes, and snippets.

View fabsor's full-sized avatar

Fabian Sörqvist fabsor

  • Leanlab
  • Göteborg
View GitHub Profile
/**
* @file
* Description of the file here.
*/
#ifndef _NETEMU_SOCKET_H
#define _NETEMU_SOCKET_H
#ifdef __cplusplus
extern "C" {
From 000cb8fd3f2ef56b8b4baf346801c081f483648a Mon Sep 17 00:00:00 2001
From: Fabian Sorqvist <fabian.sorqvist@gmail.com>
Date: Mon, 16 Apr 2012 19:26:44 +0200
Subject: [PATCH] Views integration
---
entity_translation.info | 6 +
entity_translation.module | 10 +
views/entity_translation.views.inc | 227 ++++++++++++++++++++
views/entity_translation_handler_field_label.inc | 72 ++++++
@fabsor
fabsor / gist:8400396
Created January 13, 2014 13:41
Metatag upgrade path
diff --git a/metatag.install b/metatag.install
index 777b265..1d83005 100644
--- a/metatag.install
+++ b/metatag.install
@@ -259,10 +259,12 @@ function metatag_update_7001() {
'description' => 'The primary identifier for a metatag configuration set.',
);
$keys = array('primary key' => array($field_name));
-
- // Before making any changes, drop the existing primary key. Unforunately
@fabsor
fabsor / framework_comparison.md
Last active August 29, 2015 14:00
Framework comparison

Konzilo calendar web service framework comparison

Background

When we set out to create Konzilo we had a few ideas in mind:

  • The frontend was going to be completely separate from the backend.
  • The backend should be in the form of a REST web service and should do as little as possible.
  • The data model should be flexible but we still need to ensure some form of consistency.

What we didn't know at the time was that the data model that we set out to build would turn out to be highly relational in nature. We thought of each article in the system as one document, and that document could be big and possibly consist of many sub documents. This worked out great in the beginning, but as we moved forward with the application architecture we found difficulties with this approach.

@fabsor
fabsor / gist:f09611565be9f7ca7840
Last active August 29, 2015 14:02
fix admin language
diff --git a/admin_language.module b/admin_language.module
index c6c10dd..89df82e 100644
--- a/admin_language.module
+++ b/admin_language.module
@@ -71,7 +71,10 @@ function admin_language_menu_link_alter(&$item) {
*/
function admin_language_translated_menu_link_alter(&$item, $map) {
if ('management' == $item['menu_name'] || 'user/logout' == $item['link_path']) {
- if (variable_get('admin_language_translate_admin_menu', 0)) {
+ global $language, $_admin_language;
@fabsor
fabsor / gist:27b8de2ce2b3785e6330
Last active August 29, 2015 14:04
patch for refererences dialog edit
diff --git a/js/references-dialog.js b/js/references-dialog.js
index 0c23b31..23caa22 100644
--- a/js/references-dialog.js
+++ b/js/references-dialog.js
@@ -1,52 +1,123 @@
(function ($) {
-
var $window = $(window);
-
Drupal.behaviors.referencesDialog = {
@fabsor
fabsor / gist:0ad96f5b051036199300
Last active August 29, 2015 14:04
Dynamic links and choosable add links for references dialog
diff --git a/js/references-dialog.js b/js/references-dialog.js
index 0c23b31..ac88071 100644
--- a/js/references-dialog.js
+++ b/js/references-dialog.js
@@ -1,52 +1,152 @@
(function ($) {
-
var $window = $(window);
-
Drupal.behaviors.referencesDialog = {
@fabsor
fabsor / gist:b96095c440d1982c5f92
Last active August 29, 2015 14:04
combined patches for media
diff --git a/js/media.popups.js b/js/media.popups.js
index 46af675..9b2d634 100644
--- a/js/media.popups.js
+++ b/js/media.popups.js
@@ -181,6 +181,7 @@ Drupal.media.popups.mediaStyleSelector = function (mediaFile, onSelect, options)
dialogOptions.buttons[ok] = function () {
var formattedMedia = this.contentWindow.Drupal.media.formatForm.getFormattedMedia();
+ formattedMedia.options = $.extend({}, mediaFile.attributes, formattedMedia.options);
if (!formattedMedia) {
@fabsor
fabsor / gist:c7c925c80b06ec92a52a
Created November 24, 2014 04:56
new references dialog patch
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 = {
[
{
"description": "Put them in the pan",
"title": "Delicious pancackes"
},
{
"description": "Put berries on a cake",
"title": "Epic strawberry cake"
},
{