Skip to content

Instantly share code, notes, and snippets.

Jorge Epuñan juanbrujo

Block or report user

Report or block juanbrujo

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
@juanbrujo
juanbrujo / gulpfile.js
Last active Aug 29, 2015
Basic gulpfile.js to work a basic HTML/JS/LESS/Images project under Gulp.JS/Express
View gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
var imagemin = require('gulp-imagemin');
var EXPRESS_PORT = 4000;
var EXPRESS_ROOT = __dirname;
var LIVERELOAD_PORT = 35729;
View Lavalamp---CSS3.markdown
@juanbrujo
juanbrujo / GetImagefromInstagram.js
Last active Aug 29, 2015
Get Image from Instagram: bookmarklet that get's the image shown on certain URL within Instagram
View GetImagefromInstagram.js
// Code
var url = $('.Item .iMedia .Image').attr('src');
if(url){
window.open(url,'_self');
} else {
alert('There\'s no photo.');
}
// The Bookmarklet
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f%3De.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc%3Da.createElement("script")%3Bc.type%3D"text/javascript"%3Bc.src%3D"http://ajax.googleapis.com/ajax/libs/jquery/"%2Bg%2B"/jquery.min.js"%3Bc.onload%3Dc.onreadystatechange%3Dfunction()%7Bif(!b%26%26(!(d%3Dthis.readyState)%7C%7Cd%3D%3D"loaded"%7C%7Cd%3D%3D"complete"))%7Bh((f%3De.jQuery).noConflict(1),b%3D1)%3Bf(c).remove()%7D%7D%3Ba.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.6.2",function(%24,L)%7Bvar url %3D %24(%27.Item .iMedia .Image%27).attr(%27src%27)%3Bif(url)%7Bwindow.open(url,%27_self%27)%3B%7D else %7Balert(%27There%5C%27s no photo.%27)%3B%7D%7D)%3B
@juanbrujo
juanbrujo / GetImagefromTwitter.js
Created Mar 12, 2014
Get Image from Twitter: bookmarklet that get's the image shown on certain timeline within Twitter
View GetImagefromTwitter.js
// The Code:
var url = $('.cards-media-container .media').attr('data-url');
if(url){
window.open(url,'_self');
} else {
alert('There\'s no photo.');
}
// The bookmarklet:
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f%3De.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc%3Da.createElement("script")%3Bc.type%3D"text/javascript"%3Bc.src%3D"http://ajax.googleapis.com/ajax/libs/jquery/"%2Bg%2B"/jquery.min.js"%3Bc.onload%3Dc.onreadystatechange%3Dfunction()%7Bif(!b%26%26(!(d%3Dthis.readyState)%7C%7Cd%3D%3D"loaded"%7C%7Cd%3D%3D"complete"))%7Bh((f%3De.jQuery).noConflict(1),b%3D1)%3Bf(c).remove()%7D%7D%3Ba.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.6.2",function(%24,L)%7Bvar url %3D %24(%27.cards-media-container .media%27).attr(%27data-url%27)%3Bif(url)%7Bwindow.open(url,%27_self%27)%3B%7D else %7Balert(%27There%5C%27s no photo.%27)%3B%7D%7D)%3B
@juanbrujo
juanbrujo / jquery.findLinkMakeLink.js
Created Mar 26, 2014
Find URL's within an element and wrap them
View jquery.findLinkMakeLink.js
@juanbrujo
juanbrujo / FB-resize-tab
Created Apr 3, 2014
This small script for Facebook tabs initializes FB Connect API and set's it's size acording to the iframe's width and height.
View FB-resize-tab
$.ajaxSetup({ cache: true });
$.getScript('//connect.facebook.net/es_LA/all.js', function(){
FB.init({
appId: 'appid',
});
increaseIframeSize(w,h);
});
function increaseIframeSize(w,h){
var obj = new Object;
@juanbrujo
juanbrujo / randomFromArray.less
Last active Aug 29, 2015
LESS mixin to get random from array
View randomFromArray.less
@blue: #009be1;
@green: #64c200;
@red: #ff1842;
@orange: #ffbf00;
@yellow: #ffd400;
@colors: '@{green}','@{blue}','@{red}','@{orange}','@{yellow}';
.randomFromArray(@min: 1, @max: length(@colors), @int: 0) {
@getNum: `Math.random() * (@{max} - @{min} + @{int})`;
@juanbrujo
juanbrujo / jquery.stickyNav.js
Last active Aug 29, 2015
stickyNav: easy jQuery horizontal sticky function
View jquery.stickyNav.js
/**
* jquery.stickyNav.js
**/
var stickyNav = function(elem,offset){
$(window).scroll(function(){
if( $(window).scrollTop() > offset ) {
elem.css({position: 'fixed', top: 0, 'z-index': 99});
} else {
elem.css({position: 'static', top: 0});
}
@juanbrujo
juanbrujo / example.html
Last active Aug 29, 2015
Add a class to a <header> if it reaches certain value while scrolling
View example.html
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>transformFixedNav()</title>
</head>
<body>
<header>header</header>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
#player {
position: absolute;
top: 50%;
left: 50%;
You can’t perform that action at this time.