Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Vinny Fonseca VinnyFonseca

🏠
Working from home
Block or report user

Report or block VinnyFonseca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pretty-log.txt
git log --pretty=format:"%h - %an, %ar : %s" --author="Vinny Fonseca"
@VinnyFonseca
VinnyFonseca / addeventlistener-multiple-events.js
Last active Jun 17, 2019
addEventListener multiple events
View addeventlistener-multiple-events.js
["change", "keyup", "paste", "input", "propertychange", "..."].forEach(function(event) {
document.querySelectorAll('.element').addEventListener(event, function() {
// Your callback here
}, false);
});
@VinnyFonseca
VinnyFonseca / popup.js
Last active Dec 6, 2017
New Popup Window
View popup.js
const popup = function (url, title, w = 640, h = 320) {
let l = (screen.width / 2) - (w / 2);
let t = (screen.height / 2) - (h / 2);
return window.open(url, title, `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=${w}, height=${h}, top=${t}, left=${l}`);
}
@VinnyFonseca
VinnyFonseca / fb-canvas-click-scroll.js
Last active Dec 7, 2017
FB Page Tab anchor click smooth scroll
View fb-canvas-click-scroll.js
function scrollFBTo(y){
FB.Canvas.getPageInfo(function(pageInfo) {
$({y: pageInfo.scrollTop}).animate({
y: y
}, {
duration: 500,
step: function(offset) {
FB.Canvas.scrollTo(0, offset);
}
});
@VinnyFonseca
VinnyFonseca / email-hide-images.css
Last active Dec 7, 2017
Email: Hide images in all desktop clients
View email-hide-images.css
table[class="mob-show"],
tr[class="mob-show"],
td[class="mob-show"],
span[class="mob-show"],
a[class="mob-show"],
img[class="mob-show"] {
display: none !important;
font-size: 0 !important;
width: 0 !important;
height: 0 !important;
@VinnyFonseca
VinnyFonseca / meat-viewport.html
Last active Dec 7, 2017
Meta: Viewport No Zoom
View meat-viewport.html
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
View truncate.css
.truncate {
display: inline-block;
vertical-align: top;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
View mixin-gradietn.sass
@mixin linear-gradient($fromColor, $toColor) {
background-color: $toColor; /* Fallback Color */
background-image: linear-gradient(top, $fromColor, $toColor); /* Chrome 10+, Saf5.1+, iOS 5+ */
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#{$fromColor}', EndColorStr='#{$toColor}');
}
View randomize.js
const rand = (min, max) => Math.floor(Math.random() * (max - min)) + min;
@VinnyFonseca
VinnyFonseca / fb-page-tab-like-gate.js
Last active Dec 7, 2017
Facebook Page Tab Like Gate
View fb-page-tab-like-gate.js
var appId = 'XXXXXXXXXXXXXXX';
// Taken from the App's configuration page
window.fbAsyncInit = function() {
FB.init({
appId: appId,
status: true,
cookie: true,
xfbml: true
});
You can’t perform that action at this time.