Skip to content

Instantly share code, notes, and snippets.

View arqex's full-sized avatar
💭
Bootstraping project faster allows to do more things!

Javier Marquez arqex

💭
Bootstraping project faster allows to do more things!
View GitHub Profile
@arqex
arqex / server.ts
Created April 26, 2023 15:45
Desplegar Dapp en Arweave usando deno
import { serve } from "https://deno.land/[email protected]/http/server.ts";
// Sustituye este enlace por el que devuelve el despliegue de tu aplicación
// con arkb
const fileService = "https://arweave.net/RhfPbeXFU3ieGVS5qALEnrIqeHNyeOiYnnVsmI04pPg";
async function reqHanlder( req: Request ) {
let path = new URL(req.url).pathname;
if( path === '/faq' ){
path = '/';
@arqex
arqex / gridBot.py
Created February 26, 2021 15:34
Grid bot for Trality
'''
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 09:34
webpack serverless
const slsw = require('serverless-webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const analyzer = new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
generateStatsFile: true
});
@arqex
arqex / animatedGraph.js
Created March 17, 2019 15:22
Animated graph
/**
* 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 July 20, 2018 11:22
webpack clean plugin
const Clean = require('clean-webpack-plugin')
// ...
{
// ...
plugins: [
new Clean('build/*.*', {/* options */})
]
// ...
}
@arqex
arqex / webpack.config.js
Created April 15, 2018 12:09
Webpack copy plugin
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 April 15, 2018 11:27
Config using NODE_ENV
const config = {}
if( process.env.NODE_ENV === 'production' ){
config.remoteURL = 'http://myserver.com/resource';
}
else {
config.remoteURL = 'http://localhost/resource';
}
export default config;
@arqex
arqex / webpack.config.js
Last active April 15, 2018 12:22
DefinePlugin
var webpack = require("webpack");
// ...
{
// ...
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
})
]
// ...
@arqex
arqex / installPassPillServer
Created February 26, 2018 18:10
Installing Passpill server
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 22:09
Socket event hub
// 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');