Sometimes we need only a part of a web page to print or to save to pdf. Here is a simple solution: add these lines to the page stylesheet where the #content is the id of the target DIV.
Archive for the 'tricky' Category
print or save to pdf div content
16:01 |
tricky
|
863 views
Excel – insert current date – [ ctrl+; ] not working
20:14 |
excel
, tricky |
1031 views
Goal: sometimes the current date insert not working. Find a way to solve this I don’t know why and how but sometimes the ctrl + ; stopping to work. I tried to find solution. Many of forums suggest to reinstall the whole office package… Nope… or delete the normal.dot template… nope… or just start the […]
Goal: sometimes the current date insert not working. Find a way to solve this I don’t know why and how but sometimes the ctrl + ; stopping to work. I tried to find solution. Many of forums suggest to reinstall the whole office package… Nope… or delete the normal.dot template… nope… or just start the […]
WordPress add functions – safe method
16:40 |
tricky
, wordpress |
821 views
Goal: add own functions to the wordpress site Forget the functions.php! Frankly this is working only until the next update :(. My way is to create a totally separated file with the added functions: 1. Let’s create a new file functions_added.php Never put php close tag ?> to the end of the file! 2. Put […]
Goal: add own functions to the wordpress site Forget the functions.php! Frankly this is working only until the next update :(. My way is to create a totally separated file with the added functions: 1. Let’s create a new file functions_added.php Never put php close tag ?> to the end of the file! 2. Put […]
Google Pixel Android P – Couldn’t download
11:17 |
android
, pixel, tricky |
848 views
Goal: avoid the system update issue – android 9 I have enrolled to try the new android system before the final release. Everything was fine until a disturbing issue. I tried to refresh the system and the following happened. How we can avoid this? if you can see on the top right corner I used […]
Goal: avoid the system update issue – android 9 I have enrolled to try the new android system before the final release. Everything was fine until a disturbing issue. I tried to refresh the system and the following happened. How we can avoid this? if you can see on the top right corner I used […]
PDO bind value list for IN statement
4:14 |
mysql
, tricky |
1075 views
Goal: pass value list to IN statement The PDO variable binding is easy until you want to use an IN statement like with PDO after the binding this statement is not working because in the background the select statement will be like this: Luckily the mysql knows the following tricky form and the bindable form […]
Goal: pass value list to IN statement The PDO variable binding is easy until you want to use an IN statement like with PDO after the binding this statement is not working because in the background the select statement will be like this: Luckily the mysql knows the following tricky form and the bindable form […]
swap two numbers
12:49 |
javascript
, tricky |
796 views
Goal: to enjoy he beauty of out of box thinking Everyday task to swap two numbers. Nothing easier like this, but do it in one line. The trickiest solution I have ever seen: ok, swap them this is it, simple beautiful
Goal: to enjoy he beauty of out of box thinking Everyday task to swap two numbers. Nothing easier like this, but do it in one line. The trickiest solution I have ever seen: ok, swap them this is it, simple beautiful
get function name in strict mode
13:25 |
javascript
, tricky |
821 views
Goal: show the name of the called function in strict mode If I want to see the function name I can put it like this but I like the globalized solutions and don’t forget the strict mode, where the possibilities are restricted. There is nothing else to do just throw an exception and read from […]
Goal: show the name of the called function in strict mode If I want to see the function name I can put it like this but I like the globalized solutions and don’t forget the strict mode, where the possibilities are restricted. There is nothing else to do just throw an exception and read from […]
disable title/tooltip with css
19:04 |
css
, tricky |
818 views
Goal: find simple way to hide the tooltip The problem is very simple and there are many ways to solve. I have a button or link or just a simple div with a tooltip on it. I want to create a disabled state for this control. the object like this and the style for the […]
Goal: find simple way to hide the tooltip The problem is very simple and there are many ways to solve. I have a button or link or just a simple div with a tooltip on it. I want to create a disabled state for this control. the object like this and the style for the […]
javascript easy templates
13:51 |
javascript
, tricky |
821 views
Goal: build a quick template method So we have an item template and some values to replace. Do like this way. // 1. define the parser function template(strings, …keys) { return (function(…values) { var dict = values[values.length – 1] || {}; var result = [strings[0]]; keys.forEach(function(key, i) { var value = Number.isInteger(key) ? values[key] : […]
Goal: build a quick template method So we have an item template and some values to replace. Do like this way. // 1. define the parser function template(strings, …keys) { return (function(…values) { var dict = values[values.length – 1] || {}; var result = [strings[0]]; keys.forEach(function(key, i) { var value = Number.isInteger(key) ? values[key] : […]
javascript multiline strings in the code
13:40 |
javascript
, tricky |
850 views
Goal: use multiline strings in the code I have a simple string template. I want to store it in a variable but I want to forget the concatenation. We can use the following trick. var itemTemplate = `<li> <div class=”direction-r”> <div class=”flag-wrapper”> <span class =”flag”>${0}</span> <span class =”time-wrapper”>${1}</span> </div> <div class =”desc”>${2}</div> </div> </li>`; console.log(itemTemplate); […]
Goal: use multiline strings in the code I have a simple string template. I want to store it in a variable but I want to forget the concatenation. We can use the following trick. var itemTemplate = `<li> <div class=”direction-r”> <div class=”flag-wrapper”> <span class =”flag”>${0}</span> <span class =”time-wrapper”>${1}</span> </div> <div class =”desc”>${2}</div> </div> </li>`; console.log(itemTemplate); […]