Add a Python web server on the fly to our project

If you are on linux / OsX or inside a phyton environment you can start a web server on the fly inside your project simply recalling an alias from the terminal in your project folder.

You have to edit your bash profile and add the following line:

This feature is very useful when you are working in local host with a browser that disables the origin load by default (i.e. Chrome).

inserted the alias inside the .bash_profile, refresh with the following command:

inside your project folder you just type $ server to open your web server.

Customise your terminal bash prompt

If you are using OSX this is wonderful because you can customise your command line by adding emoji icons to the bash prompt.

You can find icons inside your Edit menu: Edit -> Emoji & Symbols.

Emoji and Symbols
EDIT -> Emoji and Symbols

 

How to add custom icons to our bash?

So edit your .bash_profile with your favourite editor vim, nano for example, and add the line:

PS1=" "

Open Emoji & Symbol panel and drag and drop your favorite emoji inside quotation marks.

Grag Emoji
Drag emoji inside quotation marks

Depending on terminal settings, nothing may be visible after using drag & drop. Close and reopen you terminal and voilà:

terminal-hbYou can customise terminal bash with some others options:

\d Current date
\t Current time
\h Host name
\# Command number
\u User name
\W Current working directory (ie: Desktop/)
\w Current working directory with full path

This is my favourite customisation:

PS1="🌀  \[email protected]\h\W$ "

What’s yours?

Fontawesome icons inside a palaceholder

This is one way to use fontawesome icons inside a palaceholder:

in the CSS you have to use this code for the class fontAwesome:

After that in the HTML you have to add the **fontawesome class** first and then the **fontawesome icon code** inside the placeholder:

and it’s done!!!

You can simply apply the class every time inside your input with the relative code in the placeholder.

And even more, you can use this method by entering the code into a generic element such as a link or a simple text using the same class “fontAwesome” used for the placeholder:

You can see the result or read the post from my codePen post.

See the Pen FontAwesome and placeholders by Massimiliano Ranauro (@huckbit) on CodePen.

atom: first configuration and install

Recommended packages.

You can’t miss this packages in your atom ide configuration:

  • Emmet: to improve HTML and CSS work flow. | more info.
  • Sublime Style Column Selection: you can use the feature for vertical selection with alt – click – drag inside atom like in sublime text.
  • atom ternjs: this plugin give to you intellisense for JavaScrip. This need activatio in the properties plugin forn working.
  • file-icons: the icons for the left sidebar, I love this (really cool).
  • atom-preview-html: you can have a little browser simply pressing CTRL + SHIFT + M | package-info.
  • open-in-browser: open html in your browser | package-info.
  • minimap: a preview of the full source code sublime style | package-info.
  • pigments: a package to display colors in project and files | package-info.

Some Keyboard shortcuts

CMD – \ show/hide three
CMD – D select same items inside the document
CTRL – W text wrap html
CMD – L select line
CRTL – M parent parenthesis check
CRTL – CMD – M select code inside parenthesis

CSS: vertical-align property

You need to add the line-height attribute and that attribute must match the height of the div to center text in a div box.

This code is useful to centre text inside the box vertically and horizontally.

Centered text in a box!

Great Article about centering in css

bootstrap: change tooltip color

To change tooltip color in bootstrap add to your wrap the class “red-tooltip” (red can be another colors, simply change the color code in your css) and then add this code to the css file:

You have to change border-bottom with “right” if you want use right view or “left” in you want use left view or top for top view

css: using the @font-face directive

The secret to web fonts is a CSS command called the @font-face directive.

This command at its most basic names the font and tells the browser where to find the
font file for download.

You place the @font-face directive in your style sheet, just like a regular style.

For example, say you’re using the League Gothic font. You have a True Type file named League_Gothic-webfont.ttf inside a fonts folder on your site.

You’d instruct a browser to download this font by adding the @font-face directive to your style sheet like this:

The first property, font-family, you’ve seen before (page 127), but here it has a different purpose. When used inside an @font-face directive, font-family assigns a
name to the font.

When used inside an @font-face directive, font-family assigns a
name to the font.

For example, say you want to use the League Gothic font for all paragraphs
on a page. You could then use this style:

WP: link favicon in the theme

If there is already an old favicon.ico file in your current theme’s main folder, delete it using FTP Clients.

With an FTP Client, upload the new favicon.ico file into your current theme’s main folder.

Upload another copy of your favicon.ico file to the main directory of your site (ie. http://example.com/favicon.ico). This will display the favicon in your subscribers’ feedreaders.

In order for your favicon to show up in some older browsers, you will need to edit your page header. Remember, the best way to edit your theme’s files is via a Child Theme. For the purpose of the following instructions you will need to create a copy of your parent theme’s header.php file in your child theme.

Go to your WordPress Administration Panel.

  1. Click on Appearance.
  2. Click on Theme Editor.
  3. Select the file called Header or header.php to edit the file.
  4. Search for the line of code that begins with

    Overwrite it, if it exists, or add the following the same code below the <head> HTML tag.

more [email protected] WPcodex: Creating a Favicon

enable ssh: centos

#install:

#start the service

#status
service sshd status

#allow user: AllowUsers user_name and restart: service sshd restart

more in the wiki here.

sudoers grant

For grant sudoers to user in redhat, centos, oralce linux, edit the file /etc/sudoers and append
username ALL=(ALL) ALL
under
root ALL=(ALL) ALL

For example: