Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Focused on react native navigation and animations

Javier Marquez arqex

💭
Focused on react native navigation and animations
View GitHub Profile
@arqex
arqex / gridBot.py
Created Feb 26, 2021
Grid bot for Trality
View gridBot.py
'''
v0.2 Not sell or buy twice the same level over/under the price
'''
import math
def initialize(state):
state.number_offset_trades = 0
# 50 BUSD every time
buy_value = 50
@arqex
arqex / webpack.config.js
Created May 26, 2020
webpack serverless
View webpack.config.js
const slsw = require('serverless-webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const analyzer = new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
generateStatsFile: true
});
View animatedGraph.js
/**
* Animated works by building a directed acyclic graph of dependencies
* transparently when you render your Animated components.
*
* new Animated.Value(0)
* .interpolate() .interpolate() new Animated.Value(1)
* opacity translateY scale
* style transform
* View#234 style
* View#123
@arqex
arqex / cleanWebpackPlugin.js
Created Jul 20, 2018
webpack clean plugin
View cleanWebpackPlugin.js
const Clean = require('clean-webpack-plugin')
// ...
{
// ...
plugins: [
new Clean('build/*.*', {/* options */})
]
// ...
}
@arqex
arqex / webpack.config.js
Created Apr 15, 2018
Webpack copy plugin
View webpack.config.js
var Copy = require('copy-webpack-plugin');
// ...
{
// ...
plugins: [
new Copy({
from: 'assets/fonts',
to: 'fonts', // path relative to the build folder
toType: 'dir', // or 'file'
ignore: ['*.json'] // We can skip files
@arqex
arqex / config.js
Created Apr 15, 2018
Config using NODE_ENV
View config.js
const config = {}
if( process.env.NODE_ENV === 'production' ){
config.remoteURL = 'http://myserver.com/resource';
}
else {
config.remoteURL = 'http://localhost/resource';
}
export default config;
View webpack.config.js
var webpack = require("webpack");
// ...
{
// ...
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
})
]
// ...
@arqex
arqex / installPassPillServer
Created Feb 26, 2018
Installing Passpill server
View installPassPillServer
git clone https://github.com/passpill-io/passpill-backend.git
cd passpill-backend
npm install
npm start
@arqex
arqex / socketEventHub.js
Last active May 16, 2017
Socket event hub
View socketEventHub.js
// This helper will guide our websocket events to freezer
function toFreezer( socketEvent, freezerEvent ){
socket.on( socketEvent, function(){
var args = [freezerEvent].concat( Array.from(arguments) );
freezer.emit.apply( freezer, args );
});
}
// Now we can redirect socket events easily
toFreezer('messageReceived', 'message:received');
View messageReceivedEvent.js
// In our socket event handlers file
socket.on('messageReceived', message => {
freezer.emit('message:received', message);
});
// In our message reactions file
freezer.on('message:received', message => {
freezer.get().messages.push( message );
})