webbit

About Robin Stroobants

This author has not yet filled in any details.
So far Robin Stroobants has created 23 entries.

List all user defined functions in MSSQL

SELECT name AS function_name
,SCHEMA_NAME(schema_id) AS schema_name
,type_desc
FROM sys.objects
WHERE type_desc LIKE ‘%FUNCTION%’;

Run your website via Dropbox on your Mac

Macs come with a built-in Apache server, which is pretty handy for web development. After enabling web hosting, any files in your Sites directory will be served by Apache.

It’s often more convenient to have files in your Dropbox directory, and it’s relative simple to configure your machine to host a Dropbox subdirectory as a web page.

The basic approach is to create a symbolic link (to the required subdirectory) in your Sites directory. For example, to link to “hungrysky”

ln -s ~/Dropbox/clients/LeasePlan ~/Sites/leaseplan

You have to change your Apache configuration file to enable Apache to follow symbolic links. For example, for your custom file “webbit.conf”

sudo nano /etc/apache2/other/webbit.conf

You will have to enter your administrator password, and edit the file so that it starts with something like this:

Options Indexes Multiviews FollowSymLinks

For a complete example of your VirtualHost

<VirtualHost *:80>
ServerAdmin server@your-provider.be
DocumentRoot “/Users/your-username/Sites/sim”
ServerName sim.webbit.com
ErrorLog “/private/var/log/apache2/main-error_log”
CustomLog “/private/var/log/apache2/main-access_log” common
<Directory “/Users/your-username/Sites/sim>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHostgt;

Then you need to ensure that Apache has all the right permissions, along the entire file hierarchy and for the symbolic link. Something like:

chmod 755 ~/Dropbox
chmod 755 ~/Dropbox/clients
chmod 755 ~/Dropbox/clients/LeasePlan
chmod 644 ~/Dropbox/clients/LeasePlan/*
chmod 755 ~/Sites/leaseplan

Finally, restart Apache to apply changes.

sudo apachectl restart

Door |december 16th, 2014|Examples, OSX|0 Reacties|

Responsive Nieuwsbrief DeMorgen

Desktop View

Mobile View

Door |oktober 12th, 2014|Work|0 Reacties|

Work for change!

Wat is Zuiddag?
Zuiddag is een organisatie voor en door jongeren. Ze stimuleert jongeren wereldwijd om samen te strijden voor een duurzame en rechtvaardige maatschappij. Zuiddag is vooral gekend van de jaarlijkse campagne ‘Work for Change’ waarbij meer dan twaalfduizend Vlaamse en Brusselse scholieren tussen 15 en 20 jaar één dag niet naar school gaan, maar in de kleren van beroepskrachten kruipen. Hun verdiende loon van 40/50 euro staan ze af aan een jongerenproject in het Zuiden. Voor en achter de schermen van Zuiddag krijgen jongeren de kans om competenties te ontwikkelen in functie van een actief engagement, nu en later.

Webbit draagt graag zijn steentje bij en is op zoek naar een enthousiaste jongeling die zich een dagje wil inzetten voor dit goede doel!
Wil jij ook een dagje meedraaien als Freelance online marketing consultant?
Bekijk hier de vacature

Door |september 3rd, 2014|blog|0 Reacties|

Show form field info

Paste following in console view to quickly inspect form field id & names

$(‘input’).each(
function(index){
var input = $(this);
if (input.attr(‘type’)==”hidden”){
input.attr(‘type’,’text’);
}
if (input.attr(‘type’)==”text” || input.attr(‘type’)==”hidden”){
input.val(‘#’ + input.attr(‘id’) + ” / @” + input.attr(‘name’));
} else {
input.parent().append(‘#’ + input.attr(‘id’) + ” / @” + input.attr(‘name’) + ”);
}
}
);
$(‘textarea’).each(
function(index){
var txt = $(this);
txt.val(‘#’ + txt.attr(‘id’) + ” / @” + txt.attr(‘name’));
}
);

Using SSH Keys to login to your Joyent SmartMachine

First generate your ssh key on your local machine
Open up terminal and issue following commands:

cd .ssh
ssh-keygen -t rsa

Copy key to clipboard

pbcopy < ~/.ssh/id_rsa.pub In your Joyent Smartmachine add a new SSH Key Add host to your config file (~/.ssh/config) Host dev Hostname dev.server.be User root

Install BeautifulSoup python parser

Beautiful Soup is a Python library designed for quick turnaround projects like screen-scraping.

Beautiful Soup provides a few simple methods and Pythonic idioms for navigating, searching, and modifying a parse tree: a toolkit for dissecting a document and extracting what you need. It doesn’t take much code to write an application.

Easiest way to install beautiful soup is via pip or easy_install:

sudo pip install beautifulsoup4

sudo easy_install beautifulsoup4

Pip not installed?

sudo easy_install pip

Count number of files in a directory

cd directory_to_count
ls | wc -l

Door |juli 31st, 2014|OSX|0 Reacties|

Download entire site

wget –recursive –html-extension –page-requisites –convert-links http://www.website.com

Failed to update user password in Selligent Manager

When trying to edit/reset a users password via the Manager you receive a popup “Failed to update user”.

No other messages are given.

This probably relates to a change in user right which causes (an undocumented) dependency problem.
Though I don’t know the exact dependency, the solution is quite simple.

Right Click User and select User Properties
On the Rights tab click Edit
Confirm
Ok
Right Click User and select User Properties
Change users password and click OK

Users password is now updated