Skip to content

Instantly share code, notes, and snippets.

View bernatfortet's full-sized avatar

Bernat Fortet bernatfortet

View GitHub Profile
@bernatfortet
bernatfortet / zoomIn.js
Created April 11, 2017 15:19
Zoom Problem
// Zoom an increment towards the position of my mouse
export function zoomIn(mousePosition: Object) { return (dispatch, getState) => {
const currentZoom = getState().graphEditor.zoom
const nextZoom = currentZoom+ZOOM_INCREMENT < MAX_ZOOM ? currentZoom+ZOOM_INCREMENT : MAX_ZOOM
dispatch( storeZoom(nextZoom) )
const currentPan = selectors.getPan(getState())
const graphElement = document.getElementById("graph")
const graphOffset = {
handleKeyDown = () => {
if(event.keyCode == 32)
this.setState({ isSpacebarPressed: true })
}
handleKeyUp = () => {
if(this.state.isSpacebarPressed)
this.setState({ isSpacebarPressed: false })
@bernatfortet
bernatfortet / grubMarket.js
Last active May 25, 2017 23:36
Parse grub Market deals
javascript:(function(){
$('.cards__item').each( function( item ){
console.log('item', $(this) );
var disccountStr = $(this).find('.pct-off').text();
var disccount = parseInt( disccountStr.substring(5, disccountStr.length-1) );
if( disccount < 50 ){
$(this).remove();
}
@bernatfortet
bernatfortet / globalNodePacakges.sh
Last active May 23, 2017 22:22
Global packages
sudo npm install -g grunt-cli react-native firebase-tools n
@bernatfortet
bernatfortet / coinMarketCapTop20
Last active August 17, 2017 03:11
Reorganize coinMarketCap Top20 by volume and negative change
javascript:(function(){
tbody = $('#currencies_wrapper').find('tbody');
tbody.children()
.each( function(index, item){
if( index >= 20 )
item.remove();
});
@bernatfortet
bernatfortet / Blockstack Verification
Last active December 5, 2017 06:11
Blockstack Verification
Verifying my Blockstack ID is secured with the address 1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c https://explorer.blockstack.org/address/1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c
@bernatfortet
bernatfortet / block
Created December 5, 2017 06:11
Blocsktack 2
Verifying my Blockstack ID is secured with the address 1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c https://explorer.blockstack.org/address/1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c
export const extra = [
{
title: 'Home Assessment',
description: `First you will fill out an assessment that illuminates what life in the 21st century is for you, your family and home to make sure you understand what is causing the overwhelm and stress in your home life`,
formats: [
`Worksheet`,
`1 hour of my help at your home`,
`1 hour of my help at your home`,
],
},
@bernatfortet
bernatfortet / metacheck
Created January 27, 2018 18:08
Website step
- Check meta
http://www.heymeta.com/url/cryptagon.io
Add analytics
import create, { GetFunction, SetFunction } from 'zustand'
export type MyStore = {
flag?: boolean
actions: MyActions
}
class MyActions {