Make Git ignore file mode (chmod) changes

Question:

I have a project in which I have to change the mode of files with chmod to 777 while developing, but which should not change in the main repo.

Git picks up on chmod -R 777 . and marks all files as changed. Is there a way to make Git ignore mode changes that have been made to files?


Solution:

git config core.fileMode false


 

Advertisements

CSS : How to select an image(that is added from summernote editor) by its partial src attribute

Remark : This image is added from summernote text editor. It is saved in base64 format  (like this: <img src=”data:image/jpeg;base64,/9j/4AAQSkZJRgAEA3AD……..>) and can be updated anytime.

If you want this image (or images that may replace this image) to stay in paragraph like this:

SS

 


You can select the img tag by its partial src attribute as follows:

img[src*=”data:image/”] {
    float:left;
    margin: 0 10px 10px 0px;
}

*Now, this image or all later images will stay as you want. Feel it.

Read more/less toggle

HTML:

<html>
<head>
<title>jQuery Read More/Less Toggle Example</title>
</head>
<body>
<span class=”more”>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</span>
<br><br>

Morbi placerat imperdiet risus quis blandit. Ut lobortis elit luctus, feugiat erat vitae, interdum diam. Nam sit amet arcu vitae justo lacinia ultricies nec eget tellus. Curabitur id sapien massa. In hac habitasse platea dictumst. Integer tristique leo consectetur libero pretium pretium. Nunc sed mauris magna. Praesent varius purus id turpis iaculis iaculis. Nulla convallis magna nunc, id rhoncus massa ornare in. Donec et feugiat sem, ac rhoncus mauris. Quisque eget tempor massa.

</body>
</html>


CSS:

.morecontent span {
display: none;
}
.morelink {
display: block;
}


JS:

$(document).ready(function() {
// Configure/customize these variables.
var showChar = 100; // How many characters are shown by default
var ellipsestext = “…”;
var moretext = “Show more >”;
var lesstext = “Show less”;

$(‘.more’).each(function() {
var content = $(this).html();

if(content.length > showChar) {

var c = content.substr(0, showChar);
var h = content.substr(showChar, content.length – showChar);

var html = c + ‘<span class=”moreellipses”>’ + ellipsestext+ ‘&nbsp;</span><span class=”morecontent”><span>’ + h + ‘</span>&nbsp;&nbsp;<a href=”” class=”morelink”>’ + moretext + ‘</a></span>’;

$(this).html(html);
}

});

$(“.morelink”).click(function(){
if($(this).hasClass(“less”)) {
$(this).removeClass(“less”);
$(this).html(moretext);
} else {
$(this).addClass(“less”);
$(this).html(lesstext);
}
$(this).parent().prev().toggle();
$(this).prev().toggle();
return false;
});
});


 

How to export a mysql database using Command Prompt?

First check if your command line recognizes mysql command. If not go to command & type in:

set path=c:\wamp\bin\mysql\mysql5.1.36\bin

Then use this command to export your database:

mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql

You will then be prompted for the database password.

This exports the database to the path you are currently in, while executing this command.