Skip to content

Instantly share code, notes, and snippets.

View fwahlqvist's full-sized avatar

Fredrik Wahlqvist fwahlqvist

View GitHub Profile
@fwahlqvist
fwahlqvist / AlbumController.php
Created April 29, 2012 11:23 — forked from jasongrimes/AlbumController.php
Extension of Akrabat's ZF2 tutorial adding support for Doctrine.
<?php
namespace Album\Controller;
use Zend\Mvc\Controller\ActionController,
Album\Form\AlbumForm,
Album\Entity\Album,
Doctrine\ORM\EntityManager;
class AlbumController extends ActionController
@fwahlqvist
fwahlqvist / AlbumController.php
Created April 29, 2012 11:23 — forked from jasongrimes/AlbumController.php
Extension of Akrabat's ZF2 tutorial adding support for Doctrine.
<?php
namespace Album\Controller;
use Zend\Mvc\Controller\ActionController,
Album\Form\AlbumForm,
Album\Entity\Album,
Doctrine\ORM\EntityManager;
class AlbumController extends ActionController
@fwahlqvist
fwahlqvist / aloha-config.js
Created October 14, 2012 21:45 — forked from evo42/aloha-config.js
Aloha Editor -- send content via ajax to a backend php script to save the data edited with Aloha Editor
( function ( window, undefined ) {
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true },
errorhandling: false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630,
@fwahlqvist
fwahlqvist / readme.md
Created October 27, 2012 22:05 — forked from evo42/readme.md
Aloha Editor with textarea

Using Aloha Editor with your textarea

This is an example on how to use Aloha Editor with a traditional editable.

Note: If the textarea has a HTML ID (eg. mytxtarea) the ID of the Aloha editable will be “-aloha” suffixed (eg. mytxtarea-aloha).

For more information see the Aloha Editor Guide: http://aloha-editor.org/guides/core.html

@fwahlqvist
fwahlqvist / gist:4172473
Created November 29, 2012 22:56 — forked from samsonasik/gist:3988701
Send HTML Mail Using ZF2
use Zend\Mail\Message;
use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mime\Message as MimeMessage;
use Zend\Mime\Part as MimePart;
use Zend\Mail\Transport\SmtpOptions;
//////////
$message = new Message();
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
angular.module('app.core')
.factory('templateModifierInterceptor', [
'$q',
'$templateCache',
function($q) {
var modifiedTemplates = {};
var HAS_FLAGS_REGEX = /data-dom-(remove|keep)/;
var HTML_PAGE_REGEX = /\.html$|\.html\?/i;
return {
@fwahlqvist
fwahlqvist / dlAttachments.py
Created April 4, 2017 10:06 — forked from baali/dlAttachments.py
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'
@fwahlqvist
fwahlqvist / install_wine_homebrew_osx.sh
Created July 24, 2017 23:15 — forked from kristopherjohnson/install_wine_homebrew_osx.sh
Commands to set up OS X to run Enterprise Architect (assumes Homebrew is installed)
# Install Wine and other necessary components using Homebrew
brew install wine
brew install winetricks
brew install cabextract
# Instructions from http://www.sparxsystems.com/support/faq/enterprise-architect-WINE.html
winetricks allfonts
winetricks msxml
winetricks msxml3
winetricks msxml4