Skip to content

Instantly share code, notes, and snippets.

View FezVrasta's full-sized avatar
:electron:

Federico Zivolo FezVrasta

:electron:
View GitHub Profile
@FezVrasta
FezVrasta / gist:f95c6f09a4627a14122c
Created August 4, 2014 17:30
match words with more than 3 letters
(?:\w{3,}|[\$\@()+.])+
git checkout old_branch # Move to the branch you want to rename
git pull # So you will not lose any commit if they are not yet in your local branch
git branch -m new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@FezVrasta
FezVrasta / usage.hbs
Last active December 26, 2015 03:46
Wormhole for ember 1.6
{{#view SDC.WormholeView to="someElementId"}}
I'll be rendered somewhere
{{/view}}
<div id="someElementId"></div>
@FezVrasta
FezVrasta / gist:104ec35de539c975c712
Created November 23, 2015 12:17
Find all buttons without type
<button(?![^>]*\btype=)[^>]*?>
@FezVrasta
FezVrasta / Popper.jsx
Last active August 19, 2020 13:12 — forked from ebakan/Popper.js
React Component for Popper.js v1 that takes the reference as its first child and the popper as its second child (a la react-tether)
import React, { Component, PropTypes } from 'react';
import PopperJS from 'popper.js';
export default class Popper extends Component {
state = {}
update = () => {
if (this.popperInstance) {
this.popperInstance.scheduleUpdate();
}
/**
* Save humans, destroy zombies!
**/
const ZOMBIE_RANGE = 400;
const ME_RANGE = 2000;
const ZOMBIE_SPEED = 400;
const ME_SPEED = 1000;
function toString(a) {
@FezVrasta
FezVrasta / generatePopper.js
Last active January 2, 2017 12:20
Implementation of the legacy `parse` feature of Popper.js v0 for v1. Live example: http://codepen.io/FezVrasta/pen/RKbEQX
export default function generatePopperOnLoad(reference, popper) {
// if the popper variable is a configuration object, parse it to generate an HTMLElement
// generate a default popper if is not defined
var isNotDefined = typeof popper === 'undefined' || popper === null;
var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
if (isNotDefined || isConfig) {
popper = parse(isConfig ? popper : {});
}
}
@FezVrasta
FezVrasta / popper.min.js
Created February 20, 2017 20:30
babili 0.0.11
(function(c,d){'object'==typeof exports&&'undefined'!=typeof module?module.exports=d():'function'==typeof define&&define.amd?define(d):c.Popper=d()})(this,function(){'use strict';function c(la){const ma=la.offsetParent,na=ma&&ma.nodeName;return na&&'BODY'!==na&&'HTML'!==na?ma:window.document.documentElement}function d(la,ma){if(1!==la.nodeType)return[];const na=window.getComputedStyle(la,null);return ma?na[ma]:na}function e(la){return'HTML'===la.nodeName?la:la.parentNode||la.host}function f(la){if(!la||-1!==['HTML','BODY','#document'].indexOf(la.nodeName))return window.document.body;const{overflow:ma,overflowX:na,overflowY:oa}=d(la);return /(auto|scroll)/.test(ma+oa+na)?la:f(e(la))}function g(){const la=window.document.body,ma=window.document.documentElement;return{height:Math.max(la.scrollHeight,la.offsetHeight,ma.clientHeight,ma.scrollHeight,ma.offsetHeight),width:Math.max(la.scrollWidth,la.offsetWidth,ma.clientWidth,ma.scrollWidth,ma.offsetWidth)}}function h(la){let ma;if('HTML'===la.nodeName){const{width:
@FezVrasta
FezVrasta / popper.js
Created February 24, 2017 16:20
Popper.js 1.0.7-dev
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.0.6
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell