Salut les lecteurs pour ce nouveau projet on va créer une générateur de citation sans utiliser un API car avec l'implantation d'un API dans son code, le chargement de nouveau citations font prendre plus de temps et donc aujourdh'ui on va créer cela d'une autre maniére.La technique est si simple il suffit tous simplement de copier toutes les citations provenant d'un site je vous donnerai le lien de ce site dans le code source, après on fera appelle à JS pour nous masquer les autres citation et on n'y mettra un bouton qui quand il est cliqué nous donne automatiquement un autre citation et ça ne prendra qu'une seule seconde plus qu'a une API implémentée. Donc je vous laisse voir le résultat avec le code source. Petite astuce "Vous pouvez traduire ces citations en français pour le faire découvrir à tous le monde".
Code HTML
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<h2>Citations pour les programmeurs</h2>
<div class="text-right">
<span class="btn btn-warning">Nouveau<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></span>
</div>
<blockquote id="1" class="blockquote-reverse">
<p>Il existe deux manières de construire une conception de logiciel. Une façon est de le rendre si simple qu'il n'y ait évidemment pas de lacunes. Et l'autre façon est de le rendre si compliqué qu'il n'y ait pas de lacunes évidentes.</p>
<footer><cite title="Source Title">C.A.R. Hoare</cite></footer>
</blockquote>
<blockquote id="2" class="blockquote-reverse">
<p>"Codez toujours comme si le gars qui finirait par maintenir votre code était un psychopathe violent qui sait où vous habitez."</p>
<footer><cite title="Source Title">Martin Golding</cite></footer>
</blockquote>
<blockquote id="3" class="blockquote-reverse">
<p>"La plupart des bons programmeurs font de la programmation non pas parce qu'ils s'attendent à être payés ou à être adulé par le public, mais parce que c'est amusant à programmer."</p>
<footer><cite title="Source Title">Linus Torvalds</cite></footer>
</blockquote>
<blockquote id="4" class="blockquote-reverse">
<p>"On two occasions I have been asked [by members of Parliament]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke
such a question."</p>
<footer><cite title="Source Title">Charles Babbage</cite></footer>
</blockquote>
<blockquote id="5" class="blockquote-reverse">
<p>“To iterate is human, to recurse divine.”</p>
<footer><cite title="Source Title">L. Peter Deutsch</cite></footer>
</blockquote>
<blockquote id="6" class="blockquote-reverse">
<p>“The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.”</p>
<footer><cite title="Source Title">Seymour Cray</cite></footer>
</blockquote>
<blockquote id="7" class="blockquote-reverse">
<p>“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.”</p>
<footer><cite title="Source Title">Alan Kay</cite></footer>
</blockquote>
<blockquote id="8" class="blockquote-reverse">
<p>“Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.”</p>
<footer><cite title="Source Title">Larry Wall</cite></footer>
</blockquote>
<blockquote id="9" class="blockquote-reverse">
<p>“First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack.”</p>
<footer><cite title="Source Title">George Carrette</cite></footer>
</blockquote>
<blockquote id="10" class="blockquote-reverse">
<p>"People think that computer science is the art of geniuses but the actual reality is the opposite, just many people doing things that build on each other, like a wall of mini stones."</p>
<footer><cite title="Source Title">Donald Knuth</cite></footer>
</blockquote>
<blockquote id="11" class="blockquote-reverse">
<p>"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."</p>
<footer><cite title="Source Title">Brian W. Kernighan</cite></footer>
</blockquote>
<blockquote id="12" class="blockquote-reverse">
<p>"Measuring programming progress by lines of code is like measuring aircraft building progress by weight."</p>
<footer><cite title="Source Title">Bill Gates</cite></footer>
</blockquote>
<blockquote id="13" class="blockquote-reverse">
<p>"Sometimes it pays to stay in bed on Monday, rather than spending the rest of the week debugging Monday's code."</p>
<footer><cite title="Source Title">Christopher Thompson</cite></footer>
</blockquote>
<blockquote id="14" class="blockquote-reverse">
<p>"I don't care if it works on your machine! We are not shipping your machine!"</p>
<footer><cite title="Source Title">Vidiu Platon</cite></footer>
</blockquote>
<blockquote id="15" class="blockquote-reverse">
<p>"Computer system analysis is like child-rearing; you can do grievous damage, but you cannot ensure success."</p>
<footer><cite title="Source Title">Tom DeMarco</cite></footer>
</blockquote>
<blockquote id="16" class="blockquote-reverse">
<p>"Beware of bugs in the above code; I have only proved it correct, not tried it."</p>
<footer><cite title="Source Title">Donald E. Knuth</cite></footer>
</blockquote>
<blockquote id="17" class="blockquote-reverse">
<p>“If McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, ‘We’re sorry, here’s a coupon for two more.’ “</p>
<footer><cite title="Source Title">Mark Minasi</cite></footer>
</blockquote>
<blockquote id="18" class="blockquote-reverse">
<p>“The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability.”</p>
<footer><cite title="Source Title">Randall E. Stross</cite></footer>
</blockquote>
<blockquote id="19" class="blockquote-reverse">
<p>"Learning to program has no more to do with designing interactive software than learning to touch type has to do with writing poetry"</p>
<footer><cite title="Source Title">Ted Nelson</cite></footer>
</blockquote>
<blockquote id="20" class="blockquote-reverse">
<p>"I invented the term 'Object-Oriented', and I can tell you I did not have C++ in mind."</p>
<footer><cite title="Source Title">Alan Kay</cite></footer>
</blockquote>
<blockquote id="21" class="blockquote-reverse">
<p>"It is easier to port a shell than a shell script."</p>
<footer><cite title="Source Title">Larry Wall</cite></footer>
</blockquote>
<blockquote id="22" class="blockquote-reverse">
<p>"Perl – The only language that looks the same before and after RSA encryption."</p>
<footer><cite title="Source Title">Keith Bostic</cite></footer>
</blockquote>
<blockquote id="23" class="blockquote-reverse">
<p>"Programming is like kicking yourself in the face, sooner or later your nose will bleed."</p>
<footer><cite title="Source Title">Kyle Woodbury</cite></footer>
</blockquote>
<blockquote id="24" class="blockquote-reverse">
<p>"PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil, perpetrated by skilled but perverted professionals."</p>
<footer><cite title="Source Title">Jon Ribbens</cite></footer>
</blockquote>
<blockquote id="25" class="blockquote-reverse">
<p>“You can’t have great software without a great team, and most software teams behave like dysfunctional families.”</p>
<footer><cite title="Source Title">Jim McCarthy</cite></footer>
</blockquote>
<blockquote id="26" class="blockquote-reverse">
<p>"In theory, theory and practice are the same. In practice, they’re not."</p>
<footer><cite title="Source Title">Yoggi Berra</cite></footer>
</blockquote>
<blockquote id="27" class="blockquote-reverse">
<p>"C is quirky, flawed, and an enormous success."</p>
<footer><cite title="Source Title">Dennis M. Ritchie+</cite></footer>
</blockquote>
<blockquote id="28" class="blockquote-reverse">
<p>"Perfection [in design] is achieved, not when there is nothing more to add, but when there is nothing left to take away."</p>
<footer><cite title="Source Title">Antoine de Saint-Exupéry</cite></footer>
</blockquote>
<blockquote id="29" class="blockquote-reverse">
<p>"Talk is cheap. Show me the code."</p>
<footer><cite title="Source Title">Linus Torvalds</cite></footer>
</blockquote>
<blockquote id="30" class="blockquote-reverse">
<p>"Python's a drop-in replacement for BASIC in the sense that Optimus Prime is a drop-in replacement for a truck."</p>
<footer><cite title="Source Title">Cory Dodt</cite></footer>
</blockquote>
<blockquote id="31" class="blockquote-reverse">
<p>"Good design adds value faster than it adds cost."</p>
<footer><cite title="Source Title">Thomas C. Gale</cite></footer>
</blockquote>
<blockquote id="32" class="blockquote-reverse">
<p>"The evolution of languages: FORTRAN is a non-typed language. C is a weakly typed language. Ada is a strongly typed language. C++ is a strongly hyped language."</p>
<footer><cite title="Source Title">Ron Sercely</cite></footer>
</blockquote>
<blockquote id="33" class="blockquote-reverse">
<p>"When someone says: 'I want a programming language in which I need only say what I wish done', give him a lollipop."</p>
<footer><cite title="Source Title">Alan J. Perlis</cite></footer>
</blockquote>
<blockquote id="34" class="blockquote-reverse">
<p>"In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt."</p>
<footer><cite title="Source Title">Blair P. Houghton</cite></footer>
</blockquote>
<blockquote id="35" class="blockquote-reverse">
<p>“For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart
people with the ability to do incredibly stupid things. They are, in short, a perfect match.”</p>
<footer><cite title="Source Title">Bill Bryson</cite></footer>
</blockquote>
<blockquote id="36" class="blockquote-reverse">
<p>"FORTRAN is not a flower but a weed — it is hardy, occasionally blooms, and grows in every computer."</p>
<footer><cite title="Source Title">Alan J. Perlis</cite></footer>
</blockquote>
<blockquote id="37" class="blockquote-reverse">
<p>"In the one and only true way. The object-oriented version of 'Spaghetti code' is, of course, 'Lasagna code'. (Too many layers)."</p>
<footer><cite title="Source Title">Roberto Waltman</cite></footer>
</blockquote>
<blockquote id="38" class="blockquote-reverse">
<p>"The use of COBOL cripples the mind; its teaching should therefore be regarded as a criminal offense."</p>
<footer><cite title="Source Title">E.W. Dijkstra</cite></footer>
</blockquote>
<blockquote id="39" class="blockquote-reverse">
<p>“Considering the current sad state of our computer programs, software development is clearly still a black art, and cannot yet be called an engineering discipline.”</p>
<footer><cite title="Source Title">Bill Clinton</cite></footer>
</blockquote>
<blockquote id="40" class="blockquote-reverse">
<p>“Fine, Java MIGHT be a good example of what a programming language should be like. But Java applications are good examples of what applications SHOULDN’T be like.”</p>
<footer><cite title="Source Title">pixadel</cite></footer>
</blockquote>
<blockquote id="41" class="blockquote-reverse">
<p>“I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing.”</p>
<footer><cite title="Source Title">Oktal</cite></footer>
</blockquote>
<blockquote id="42" class="blockquote-reverse">
<p>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.”</p>
<footer><cite title="Source Title">Mosher’s Law of Software Engineering</cite></footer>
</blockquote>
<blockquote id="43" class="blockquote-reverse">
<p>“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”</p>
<footer><cite title="Source Title">Eric S. Raymond</cite></footer>
</blockquote>
<blockquote id="44" class="blockquote-reverse">
<p>"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone."</p>
<footer><cite title="Source Title">Bjarne Stroustrup</cite></footer>
</blockquote>
<blockquote id="45" class="blockquote-reverse">
<p>"A C program is like a fast dance on a newly waxed dance floor by people carrying razors."</p>
<footer><cite title="Source Title">Waldi Ravens</cite></footer>
</blockquote>
<blockquote id="46" class="blockquote-reverse">
<p>"A programming language is low level when its programs require attention to the irrelevant."</p>
<footer><cite title="Source Title">Alan J. Perlis</cite></footer>
</blockquote>
<blockquote id="47" class="blockquote-reverse">
<p>"They don't make bugs like Bunny anymore."</p>
<footer><cite title="Source Title">Olav Mjelde</cite></footer>
</blockquote>
<blockquote id="48" class="blockquote-reverse">
<p>"Walking on water and developing software from a specification are easy if both are frozen."</p>
<footer><cite title="Source Title">Edward V Berard</cite></footer>
</blockquote>
<blockquote id="49" class="blockquote-reverse">
<p>"Lisp isn't a language, it's a building material."</p>
<footer><cite title="Source Title">Alan Kay</cite></footer>
</blockquote>
<blockquote id="50" class="blockquote-reverse">
<p>"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."</p>
<footer><cite title="Source Title">Rick Cook</cite></footer>
</blockquote>
<div class="source">Source: <a href="http://www.junauza.com/2010/12/top-50-programming-quotes-of-all-time.html" target="_blank">Top 50 Programming Quotes of All Time</a></div>
</div>
</div>
<div class="text-center">
Codée par:
<a href="/" target="_blank">Coding Team</a>
</div>
</div>
Code CSS
body {
background-color: #ab8235;
background-image: linear-gradient(90deg, rgba(255,255,255,.07) 50%, transparent 50%),
linear-gradient(90deg, rgba(255,255,255,.13) 50%, transparent 50%),
linear-gradient(90deg, transparent 50%, rgba(255,255,255,.17) 50%),
linear-gradient(90deg, transparent 50%, rgba(255,255,255,.19) 50%);
background-size: 13px, 29px, 37px, 53px;
}
.col-sm-offset-3 {
position: relative;
min-height: 400px;
margin-top: 50px;
margin-bottom: 10px;
padding-top: 20px;
padding-bottom: 20px;
background-color: rgba(255,255,255,.75);
border-radius: 3px;
text-align: center;
}
.btn {
margin-top: 20px;
margin-bottom: 40px;
}
.btn-warning {
background: #ab8235;
border: 0;
}
.glyphicon {
margin-left: 3px;
}
blockquote {
display: none;
}
.blockquote-reverse, blockquote.pull-right {
border-right: 5px solid rgba(171, 130, 53, 0.6);
}
blockquote[id="3"] {
display: block;
}
.source {
position: absolute;
bottom: 10px;
right: 30px;
}
.source a {
font-style: italic;
}
Code JavaScript
var $btn = $('.btn'),
$quotes = $('blockquote');
$btn.on('click', function() {
// get random number between 1 - 50
var randomnumber = Math.floor(Math.random() * (50)) + 1;
// hide all quotes
$quotes.hide();
// show new quote
$('#' + randomnumber).fadeIn(600);
});