Skip to content

Instantly share code, notes, and snippets.

View marcofugaro's full-sized avatar

Marco Fugaro marcofugaro

View GitHub Profile
@marcofugaro
marcofugaro / README.md
Last active September 14, 2020 15:16
Paste this in the console of your github profile page and start drawing on your contributions!

Made to work along with gitfiti, you can draw with this tool and then export the data and use it with gitfiti.

##Usage

  1. Paste the code in the console of any github profile page which has the contributions graph
  2. Start drawing! Left click to increment the color, right click to clear the cell, clear button to clear everything! Dragging also works!
  3. Once you're happy you can export the data by typing ContributionsDraw.export() into the console.
  4. Or if you want you can also import existing data with ContributionsDraw.import([...])

NOTE: This is developed for and tested in Chrome, other browsers might not support yet some ES6 stuff, you might need to compile it to ES5.

@marcofugaro
marcofugaro / index.html
Created January 13, 2016 08:53
`background-size: cover` and `background-position: center center` on img element with jQuery
<div class="img-container">
<img src="http://placehold.it/550x800">
</div>
@marcofugaro
marcofugaro / contact-form.js
Last active February 1, 2024 08:30
simple php mail snippet with PHPMailer through SMTP and Google reCAPTCHA
var form = $('#form');
form.find('[type="submit"]').on('click', function(e) {
var isFormValid = form[0].checkValidity();
var isCaptchaOk = $('#g-recaptcha-response').val();
if(isFormValid && isCaptchaOk) {
e.preventDefault();
var dataObj = {
@marcofugaro
marcofugaro / handlebars-if.js
Created November 16, 2015 19:31
If operator in Handlebars.js
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
case '!=':
return (v1 != v2) ? options.fn(this) : options.inverse(this);
case '!==':