Skip to content

Instantly share code, notes, and snippets.

View bichotll's full-sized avatar
😶
Doing stuff..

Jaume Tarradas Llort bichotll

😶
Doing stuff..
View GitHub Profile
@bichotll
bichotll / guid.js
Created September 8, 2016 15:06
guid generator
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
@bichotll
bichotll / index.html
Created September 5, 2016 09:01 — forked from anonymous/index.html
flickity smooth zoom effect w/ JSBin// source http://jsbin.com/rewukuguye
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/flickity/2.0.3/flickity.pkgd.js" ></script>
<meta charset="utf-8">
<style rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flickity/2.0.3/flickity.min.css"></style>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.tab-container {
padding: 15px;
}
@bichotll
bichotll / index.html
Last active August 31, 2016 08:49 — forked from anonymous/index.html
Awesome effect for carousel http://jsbin.com/rewukuguye
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/flickity/2.0.3/flickity.pkgd.js" ></script>
<meta charset="utf-8">
<style rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flickity/2.0.3/flickity.min.css"></style>
@bichotll
bichotll / inner-media.scss
Created August 10, 2016 10:49
Inner media on sass
.star {
font-size: 28px;
margin-left: 2px;
color: #E3E5E7;
@media screen and (min-width: 768px) {
width: 900px;
}
}
@bichotll
bichotll / search-box-test.js
Created August 9, 2016 09:21
Ember - Search box test
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
const routerStub = Ember.Service.extend({
transitionTo() {
return '';
}
});
@bichotll
bichotll / easier-bem-with-sass.scss
Created August 5, 2016 09:54
Easier bem with sass
.svg{
&__sub-element{
color: red;
&--state{
color: cheesy-pink;
}
}
background: url(path/fdfs);
}
/**
* Returns the tests to be run
*/
function getFailedTests() {
var cases = [];
$('h3:not(.hidden)').each(function(){
cases.push($(this).text().match(/[0-9]*\.[0-9]*/)[0]);
})
return "...test -c " + (cases.join(' -c '));
}
@bichotll
bichotll / rs.js
Created May 13, 2016 09:11
Get title of the task to create a branch
/**
* Returns the name of the branch regarding the task number and title
* @example XXX-129-remove-blank-space-from-selector-view
*/
function rsGetTitle() {
return $('#key-val').text() + '-' + $('#summary-val').text().toLowerCase().replace(/ /g, '-');
}
window.getGitTag = function(){
return (
$('#content > h2').text().replace('#', '') +
'-' +
$('#content .subject h3').text().replace('-', '')
).replace(' ', '-').toLowerCase();
};