Skip to content

Instantly share code, notes, and snippets.

View andreuscafe's full-sized avatar

Andrés Nicolás Tonello andreuscafe

View GitHub Profile
@andreuscafe
andreuscafe / anywhere.js
Created September 13, 2018 17:01
UI5 - Set data to model even if property doesn't exist
setData: function (path, data) {
var model = this.getModel();
// Target initialize as a root reference of model (which is an object!)
var target = model.getData();
var aPath = path ? path.split("/") : "/";
// This function is named 'getTarget' but it also does assign data to the target.
var getTarget = function (pathParts, i) {
if (typeof i === "undefined") i = 0;
@andreuscafe
andreuscafe / step4
Created April 4, 2017 20:37
step4 epic
<%= render 'shared/owner/steps' %>
<section class="panel panel-default wizard">
<div class="panel-body">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<!-- Content -->
<h3>Show off your business to potential customers! <br>Upload between 3 and 16 images.</h3>
@andreuscafe
andreuscafe / galleries.coffee
Created February 13, 2017 18:45
Funcion para galerias
class GalleryName
constructor: (name, form, confirmBtn, cancelBtn, editBtn)->
@name = $('.js-name')
@form = $(form)
@confirmBtn = $(confirmBtn)
@cancelBtn = $(cancelBtn)
@editBtn = $(editBtn)
if @name.lenght
@galleryNameValue = @name.html().trim()
@andreuscafe
andreuscafe / oocss-bem-smacss
Created August 24, 2016 17:13
Metodologías de trabajo con CSS
Comparación entre diferentes metodologías de trabajo con CSS:
OOCSS:
██████╗ ██████╗ ██████╗ ███████╗ ███████╗
██╔═══██╗ ██╔═══██╗ ██╔════╝ ██╔════╝ ██╔════╝
██║ ██║ ██║ ██║ ██║ ███████╗ ███████╗
██║ ██║ ██║ ██║ ██║ ╚════██║ ╚════██║
@andreuscafe
andreuscafe / delay_animations.js
Last active April 15, 2016 17:48
Event Listener Delay on Animations
$(document).on('ready', function() {
function your_shitty_function () {
var animationTime = 300;
var quietPeriod = 100;
var lastAnimation = 0;
$('.your-shit-class').on('mousewheel', function(e) {
//Getting actual time when event success
var timeNow = new Date().getTime();