Postman: Use result data in test scripts (and save to environment)
Published 2015-03-10, 21:41
Just use ‚request‘ in the test script:
- request.data is an object with all the request parameters
- request.url contains the requested URL
- request.method contains the used request method
- request.headers is an object with all the headers
Makes so many things easier 🙂
Postman (REST Client) Tests
Published 2014-10-31, 16:04
### VORBEREITUNG ### // save response in env var data = responseBody; postman.setEnvironmentVariable("data", data); // parse value from json and save in env var data = JSON.parse(responseBody); postman.setEnvironmentVariable("device_id", data.id); // parse array from json and safe as string and save in env var data = JSON.parse(responseBody); var product = JSON.stringify(data[0]); postman.setEnvironmentVariable("contentful", product); // parse array from json, change value, and safe as string and save in env var data = JSON.parse(responseBody); data.locale = "en_US"; var device_update = JSON.stringify(data); postman.setEnvironmentVariable("device_update", device_update); ### TESTS ### // test resposonse code tests["Status code is 200"] = responseCode.code === 200; // test if response is empty var data = JSON.parse(responseBody); tests["Transaction list is empty"] = data.length === 0; // test if body contains value tests["Body contains string" + environment.device_id] = responseBody.has(environment.device_id); // test exact values of json var data = JSON.parse(responseBody); tests["transaction.id is " + environment.transaction_id] = data.id === environment.transaction_id; tests["transaction.state is IN_PROGRESS"] = data.state === "IN_PROGRESS";
Managing Twitter Lists
Published 2013-11-09, 22:37
I started to group my „twitter users I follow“ (Why is there no better word?) in (public and private) thematic lists to be able to follow them seperately. List management in Twitter’s web and mobile apps lacks a lot of features, so I went to trusted Google to find what is out there. Here are my 3 recommentations:
- http://twitlistmanager.com – Super easy list of users I follow and checkboxes for all lists I have. Saved in batches.
- http://icotile.ogaoga.org – Drag and drop with the twitter avatar makes it easy to spot people that don’t belong in a list. Saves every change indicidually.
- http://tweetbe.at – Theoretically more powerful than the other two because of automation options, practically a bit broken though 🙁 I still include it here, because it is what I actually want to have.
With these tools I was able to move some people around and dramatically clean up my lists.
Now to find (or create) a Twitter client that is made for lists and this style of reading. (On Windows, I recommend Tweetdeck.)
How to use private and business Dropbox accounts on Windows (7) at the same time?
Published 2013-11-04, 22:17
There seem to be two working options:
- http://nionsoftware.com/dbpahk/instructions
This one got a nice installer and you can choose a colored icon so you can actually recognize your private/business Dropbox systray icon.
But it uses an older Dropbox installer. - http://semi-legitimate.com/blog/item/multiple-dropbox-instances-on-windows-7
Here you need to create a second user account so Dropbox can save its configuration somewhere. Nice hack, but very hacky.
I’m testing (1) right now and for now it seems to work great. Hope it keeps working.
Dropbox for Business
Published 2013-11-04, 10:26
I had to research Dropbox for Business today. Here are the most interesting links and help files:
- https://www.dropbox.com/business
- https://www.dropbox.com/help/422/de – Overview
- https://www.dropbox.com/help/category/Business
- https://www.dropbox.com/help/211/de – Convert private to business account
- https://www.dropbox.com/help/389/de – Move files between 2 accounts
- https://www.dropbox.com/help/224/de – Differences private vs. business
- https://www.dropbox.com/help/429/de – Switch accounts
Nice product, well executed. And if you want some advice: Create a business account as soon as possible to avoid the moving of stuff and shared folders. That can really be a pain.
WordPress Multisite
Published 2013-11-03, 23:00
Today I spent some time reading up on WordPress Multisite. It was born out of WordPress MU and included in the Core of WordPress since version 3.0, but I never got around to really understand and use it. Here we go:
Information
- http://codex.wordpress.org/Glossary#Multisite
- http://codex.wordpress.org/Create_A_Network
- http://codex.wordpress.org/Before_You_Create_A_Network
- http://codex.wordpress.org/Network_Admin
- http://codex.wordpress.org/Multisite_Network_Administration
- http://codex.wordpress.org/Debugging_a_WordPress_Network
- http://toscho.de/2013/wordpress-multisite-mit-mehreren-domains/
Plugins
- http://wordpress.org/plugins/wordpress-mu-domain-mapping/ + http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/
- http://wordpress.org/plugins/multisite-enhancements/
- http://wordpress.org/plugins/networks-for-wordpress/
- http://wordpress.org/plugins/multisite-user-management/
- http://wordpress.org/plugins/safecss/
- http://wordpress.org/plugins/wordpress-mu-sitewide-tags/
- http://wordpress.org/plugins/sitewide-comment-control/
- http://wordpress.org/plugins/network-only-plugins-tab/
Special Cases
- http://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite
Future
- http://make.wordpress.org/core/2013/10/06/potential-roadmap-for-multisite/
Summary
Multisite seems to work fine but sometimes behaves a bit strange, especially if you want to do special things that it’s not (really) supposed to do. The documentation lacks a lot (note to myself: maybe help) and the not-in-the-focus development from MU to Multisite causes lots of problems with old blogs posts, strange wording and information, confusing everybody. So I’m going to try using it.
Laravel 4, Eloquent: Check if there is a Model with certain key-value pair in a Collection
Published 2013-10-17, 16:47
I wanted to find out if there already is a Model with a certain value for a certain column in a Collection that I retrieved realier in my code, e.g. is there already a User with name = Müller in my $users Collection?
$users->contains() can only check if there is a model with a certain primary key, and there also is no method to trivially search through all Models. Of course this all could be hacked together somehow*, but after a bit of searching I found this nice way to solve my question:
$value = 'Müller'; $key = 'name'; if(in_array($value, $users->lists($key))) { ... }
Collection->lists() gets an array with all the values of the Model for the requested key. Checking if our new value is in there, is super simple.
*Of course I first tried it this way:
- use $collection->filter() and then count the result
- hack $collection->contains() +$collection->find() to accept a field name as a parameter
- see 2, but copy the methods as private methods to my controller instead of tinkering with the framework code directly
All 3 solutions worked, but needed lots of ugly code.
How to connect to Campfire using your favorite IRC client
Published 2013-10-12, 17:08
The team of a new project uses Campfire for group chat. Campfire is 37signal’s web based chat solution from back when they launched a new product every few months.
I don’t like chatting in a browser. And I’m a Windows guy and all the native Campfire clients for Windows work, but are not very pretty. You could probably even say they are a bit ugly. That’s why I went on a hunt to get Campfire into a Jabber or IRC client.
I’m in IRC all the time on freenode for several development channels, so I was really happy to find a small script that builds a brigdge between the Campfire API and IRC: https://github.com/zerowidth/camper_van
Here is a small ‘how to’ on how to get it to work on Windows:
- Download Ruby Installer: http://rubyinstaller.org/downloads (I would suggest using the 1.9.3 version.)
- Use these options for the installation:
- Download the matching Development Kit from the same site.
The installer is a bit crappy, make sure to extract to a new folder on your HD (e.g. “C:/Ruby Devkit”).
Run the following commands in a command prompt in this directory:
ruby dk.rb init
ruby dk.rb install - Now you can install the camper_van Ruby gem:
gem install camper_van
(Will take a while) - Run camper_van to start the Campfire-IRC-bridge
Now you can connect to 127.0.0.1 on port 6667 using “##campfire_subdomain##:##your_api_key##” (You can find both on your member site of the Campfire chat room) in your favorite IRC client. After connecting, /join #channelname to join your channel and you’re done.
camper_van translates all nicknames from “Foo Bar” to “foo_bar” so you can use it to reply to people in chat and your client can inform you if you were mentioned. Same for images or tweets, should all work.
PHP Frameworks
Published 2013-10-02, 11:16
As I’m getting back into working with PHP more hands-on I spent some time to look around to build this small overview of PHP frameworks. I seperated them into 3 groups: Most popular, Others and Obscure / Ancient / Dead.
Most popular
- http://framework.zend.com/
- http://symfony.com/
- http://cakephp.org/
- http://ellislab.com/codeigniter
- http://kohanaframework.org/
- http://www.yiiframework.com/ + https://github.com/yiisoft/yii
- http://fuelphp.com/
- http://laravel.com/ + https://github.com/laravel/laravel
Google Trends graphes
To be able to assess the popularity, these simple Google Trend charts may help:
The „old guys“
(WTH happened in October 2009?)
The „new guys“ (+ ZF for comparison)
Please note, that many people probably only search for „Zend“ to find Zend Framework.
Others
- http://flow.typo3.org/
- http://silex.sensiolabs.org/ (Micro Framework)
- http://phalconphp.com/en/ (Speed!)
- http://www.slimframework.com/ (Micro Framework)
- http://www.yafdev.com/+ https://github.com/laruence/php-yaf (Speed!)
- http://lithify.me/
- http://zetacomponents.org/ + https://github.com/zetacomponents
- http://www.pradosoft.com/ + https://github.com/pradosoft/prado (founder left, now creates yii – team still active!)
- http://www.hazaarmvc.com/
- http://auraphp.com/
- http://www.agavi.org/
- http://fatfreeframework.com/home
Obscure / Ancient / Dead
- http://www.recessframework.org/ (last updated 2010)
- http://solarphp.com/ (replaced by Aura)
- http://jelix.org/
- http://www.phpontrax.com/
- http://www.phpdevshell.org/
- http://www.openbiz.me/developer/framework.php
- http://www.phpwact.org/
- https://github.com/akelos
- http://sourceforge.net/projects/cgiapp/
- http://xyster.libreworks.com/
- https://github.com/appflower
- http://www.qcodo.com/
- http://adventure-php-framework.org/Seite/001-Startseite
- http://zikula.org/
- http://www.redsparkframework.de/ (CMS framework)
- http://www.doophp.com/
- http://seagullproject.org/
- http://nette.org/
- http://alloyframework.org/
- http://www.banshee-php.org/
- http://www.dingoframework.com/
- https://burnercms.com/
- http://phpixie.com/
- http://code.google.com/p/kata/
Sources
- http://www.phpframeworks.com/
- http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#PHP
- Google „php framework“
Firefox Tab Groups – Making Firefox even more useful
Published 2013-09-27, 14:00
Somewhere between Firefox 3 and the current Firefox 23 Mozilla decided to add the concept of „tab groups“ to the browser. I don’t know exactly when, because I didn’t notice it. But it absolutely changed how I use Firefox.
Before, most of the time I had 2+ Firefox windows open to seperate different tabs depending on the content, task or context. I listen to music most of the time, very often in web based sites like Soundcloud or Mixcloud, for example. A second window had become my queueing system for the music I wanted to listen to next.
Tab groups offer a better solution to that problem:
- https://support.mozilla.org/kb/tab-groups-organize-tabs
- https://support.mozilla.org/kb/mastering-tab-group-editor
Now I just have a second tab group open all the time where I put the music related tabs. I pin the currently playing tab, so I can also access it from my normal work tab to be able to be able to stop and resume the music. When a song is finished, I close the pinned tab, switch to the other tab group and select my next track, start and pin it, and continue working. Without ever leaving the current Firefox window.
It’s not perfect. But that’s what add-ons are here for:
- https://addons.mozilla.org/de/firefox/addon/tab-group-switcher/
- https://addons.mozilla.org/de/firefox/addon/panolink/
With these two I can change between tab groups with one click (before, you had to go to a tab grou overview and then select the tab group), and open links and bookmarks directly in any of the open tab groups.