Skip to content

Instantly share code, notes, and snippets.

View xxGus's full-sized avatar

Gustavo Baptista xxGus

View GitHub Profile
@xxGus
xxGus / my_plugin_name.php
Created January 11, 2022 19:45
How to create a wordpress plugin?
<?php
/**
* Plugin Name: My Plugin Name
* Plugin URI: https://github.com/xxGus
* Description: A simple plugin
* Version: 1.0.0
* Author: Gustavo Baptista
* Author URI: https://github.com/xxGus
* License: GPL-2.0+
Changing models
- Change your models (in models.py).
- Run python manage.py makemigrations to create migrations for those changes
- Run python manage.py migrate to apply those changes to the database.
> react-boilerplate@4.0.0 start /Users/gustavobaptista/Documents/projects/barney
> cross-env NODE_ENV=development node server
/Users/gustavobaptista/Documents/projects/barney/node_modules/html-webpack-plugin/index.js:59
compilation.hooks.htmlWebpackPluginAlterChunks = new SyncWaterfallHook(['chunks', 'objectWithPluginRef']);
^
TypeError: Cannot add property htmlWebpackPluginAlterChunks, object is not extensible
at /Users/gustavobaptista/Documents/projects/barney/node_modules/html-webpack-plugin/index.js:59:56
at Hook.eval [as call] (eval at create (/Users/gustavobaptista/Documents/projects/barney/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:102:1)
@xxGus
xxGus / error
Created January 21, 2021 11:50
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using npm@6.14.10
3 info using node@v14.15.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle react-boilerplate@4.0.0~prestart: react-boilerplate@4.0.0
6 info lifecycle react-boilerplate@4.0.0~start: react-boilerplate@4.0.0
7 verbose lifecycle react-boilerplate@4.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle react-boilerplate@4.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/gustavobaptista/Documents/projects/barney/node_modules/.bin:/Users/gustavobaptista/.pyenv/plugins/pyenv-virtualenv/shims:/Users/gustavobaptista/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/gustavobaptista/.pyenv/plugins/pyenv-virtualenv/shims:/Users/gustavobaptista/.pyenv/shims:/opt/flutter/bin:/opt/flutter/bin
9 verbose lifecycle react-boilerplate@4.0.0~start: CWD: /Users/gustavobaptista/D
@xxGus
xxGus / notes.txt
Created December 17, 2019 01:20
Machine learning notes
Loss function —This measures how accurate the model is during training. You want to minimize this function to "steer" the model in the right direction.
Optimizer —This is how the model is updated based on the data it sees and its loss function.
Metrics —Used to monitor the training and testing steps. The following example uses accuracy, the fraction of the images that are correctly classified.
@xxGus
xxGus / notes.txt
Last active January 23, 2020 00:29
Machine learning notes
Loss function —This measures how accurate the model is during training. You want to minimize this function to "steer" the model in the right direction.
Optimizer —This is how the model is updated based on the data it sees and its loss function.
Metrics —Used to monitor the training and testing steps. The following example uses accuracy, the fraction of the images that are correctly classified.
Class label = grupo de valores, geralmente a mesma coisa
Keras = API com diversas funções para ML, ela possui diversos datasets para poder treinar seus modelos
exemplo de um problema: se usar uma imagem de 28x28 pixels, vc só vai conseguir testar com uma imagem desse tamanho.
Por que ele decidiu que esses layers são os principais pra esse tipo de modelo?? pq usar o Dense e pq 128 ou 10 nós?
Ctrl+Shift+P
> Debug: Attach to Flutter on Device
if you didn't start a device, the extansion will required to do it.
On terminal, run :
>flutter run
@xxGus
xxGus / adding-svg.dart
Created July 29, 2019 18:03
Flutter: adding SVG
final String assetName = 'assets/image.svg';
final Widget svg = new SvgPicture.asset(
assetName,
semanticsLabel: 'Acme Logo'
);
final String assetName = 'assets/up_arrow.svg';
final Widget svgIcon = new SvgPicture.asset(
assetName,
color: Colors.red,
@xxGus
xxGus / container-bg-image.dart
Last active April 27, 2021 19:33
Flutter Container background image
class BaseLayout extends StatelessWidget{
@override
Widget build(BuildContext context){
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bulb.jpg"),
fit: BoxFit.cover,
),