A collection of programming & webdesign
Programming • JavaScript
jQuery toggle with Flexbox

If you want to toggle a container which is a flexbox, one  of the easiest ways, in fact, is to surround your flex container with a standard block container and then use the toggle function on the block container, like so:

... read more
More
Word: Paragraph above Table

If you've got a MS Word document with a table at the very beginning and other things below and you want to add a text paragraph above the table at the beginning, just do this:

  • Press Ctrl + Pos1 (brings the cursor to the very beginning of the document)
  • Press Enter
Programming • C#
Modifiers

Modifiers in C#:

  • internal (default for classes)
  • private (default for methods, variables)
Programming • C#
C# Printing Strings

There are three ways of printing strings in C#:

  1. The “classic” way:
    Console.WriteLine("Hello " + world);
  2. Using a placeholder:
    Console.WriteLine("Hello {0}", world);
  3. Using $:
    Console.WriteLine($"Hello {world}, today is {date_time}");
Programming • C#
Classes

A class should always have a constructor. The constructor initiates the data members.

The keyword this references to current class data members.

Structure of a class:

  1. includes
  2. parameters
  3. constructor
  4. methods
... read more
Programming • C#
OOP

OOP is based on 4 pillars:

  1. Abstraction: makes process/functionality abstract
  2. Polymorphism: one entity, many forms
  3. Encapsulation: protect methods and variables
  4. Inheritance

There's also OOAD. OOAD is object-oriented analysis and design. It's a technical approach for analyzing an ddesigning an application, system, or business by applying OOP as well as using visual modeling.

More
WEDR - Windows Explorer doesn't refresh

WEDR - Windows Explorer doesn't refresh: it describes a very common problem a lot of users are facing. It means you're a Windows user and when using the file explorer or desktop you notice it's not refreshing instantly. So, if you want to see the changes you made, you always have to refresh the explorer or desktop manually using the context menu - which is, in fact, a pain in the a**.

... read more
Design • Adobe Photoshop
Photoshop open closed path

In Photoshop paths can be open and closed. If you have a closed path and want to reopen it, do the following:

Use the tool Covert Point (<) for direct selection, select the part of the path you want to delete and press DEL. After this the path is open.

Programming • C++
Single and double quotes

Whereas in some programming languages it doesn't matter if you use single or double quotes, it matters highly in C++ (and some others, such as Java, also). For example, if you're a webdeveloper and write a function in JavaScript, you can even mix them and it will still work and give you the right output (as long as you don't use single ones at the beginning and doubles at the end of the same string).

... read more
Programming • JavaScript
JS time format HH:mm

Just because I couldn't believe it… obviously there's no easier way in JavaScript to show the time in HH:mm (e.g. 11:05) then to build the string yourself, using if-conditions and adding the zero manually where needed:

... read more
Programming • C++
Initializing variables

While in Java, for example, you get an error if you want to run a function which contains a variable that hasn't been initialized  java: variable x might not have been initialized , not so in C++ and that can be tricky.

In C++ variables which haven't been initialized get random values which can or will almost always lead to unexpected results.

... read more
Programming • Laravel
Laravel maintenance mode

While working on a live Laravel project it might be useful to set the page in a maintenance mode, so that users visiting it, won't see any errors while work's in progress.

For this, practically just log into the server where your project is located, navigate to your project folder and there use the command  php artisan down . This sets your application in a maintenance mode. What people visiting your page then will see is a standard Laravel maintenance page.

... read more
Webdesign • HTML
Favicons

Using favicons for your website or web application is a nice and handy thing. 

  1. Search the internet for a favicon generator
  2. Add your image and let it create you a bundle of favicons
... read more
Webdesign • HTML
Theme Color

To adjust the theme color of your website on a mobile phone, just add the following meta tag to your HTML <head>:

 <meta name="theme-color" content="#000000"> 

The color given in “content” will be used as theme color of your website.

Design • Adobe InDesign
InDesign: how to delete single page numbers

Page numbers in InDesign:

  1. Set page numbers on master page(s):
    1. Use text field to place and style
    2. Text > Special chars > markers
... read more
Programming • Laravel
Laravel passing several variables to view

There are several ways of passing multiple variables to a view in Laravel:

1. Using with()

... read more
Design • Adobe InDesign
InDesign useful shortcuts

Fit page in window = Ctrl + 0

Preview/Display rendering quality:

  • Ctrl + Alt + Z = normal
  • Ctrl + Alt + H = high

Switch to preview mode:

  • W : if not in text mode (to turn on and off)
    or first
  • Ctrl + Shift + A = deselect all →  then W
... read more
Webdesign • HTML
SVG polygons

Create beautiful backgrounds or forms you need with the <svg> tag using the viewBox:

viewBox values: “ min-width min-height width height ”

<svg viewBox="0 0 2000 280" preserveAspectRatio="none" width="100%" height="280">
   <polygon points="0,280 2000,280 2000,20"
            style="fill:#f9f0e6; opacity: .65"/>
</svg>
Programming • Laravel
Laravel defaults xampp & mamp

Xampp:

APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=my_db
DB_USERNAME=root
DB_PASSWORD=

... read more
Programming • Laravel
Laravel date language

Obviously, there are several methods of setting up the language of a date in Laravel. I was finally successful with the following one:

1. AppServiceProvider:

public function register()
    {
        setlocale(LC_TIME, config('app.locale'));
    }

... read more