Skip to content

Instantly share code, notes, and snippets.

View SonPatrick's full-sized avatar
⚔️
𝙸 𝙰𝙼 𝚃𝙷𝙴 𝙴𝙳𝙶𝙴

Patrick Son SonPatrick

⚔️
𝙸 𝙰𝙼 𝚃𝙷𝙴 𝙴𝙳𝙶𝙴
View GitHub Profile
@SonPatrick
SonPatrick / velocity-plus.sh
Created May 7, 2024 13:26 — forked from AndersonFirmino/velocity-plus.sh
Programas que ajudam a melhorar desempenho Linux/Pc modestos
#!/bin/sh
# script para instalar programas que ajudam no desempenho.
echo "Esta de acordo em fazer o upgrade? (digite: ok e tecle enter se sim) "
read certeza
if [ "$certeza" = "ok" ]
then
sudo apt-get install zram-config -y
sudo apt-get install preload -y
sudo apt-get install prelink -y

Flutter install without android studio

set flutter

Download flutter

tar xvf flutter_linux_1.17.5-stable.tar.xz

@SonPatrick
SonPatrick / README.md
Created April 29, 2024 16:38 — forked from ullaskunder3/README.md
Detail flutter installation without android studio just using cmdline-tools, git, cmd
@SonPatrick
SonPatrick / provider.dart
Created November 23, 2023 17:45 — forked from hanskokx/provider.dart
Flutter Provider example
import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(
ChangeNotifierProvider(
create: (context) => ShoppingCartProvider(),
child: const MyApp(),
@SonPatrick
SonPatrick / main.dart
Created August 1, 2023 12:51 — forked from ggichure/main.dart
flutter theme changer and persist with shared prefrences
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
//https://stackoverflow.com/a/53107519/10409567
void main() async {
// load the shared preferences from disk before the app is started
WidgetsFlutterBinding.ensureInitialized();
final prefs = await SharedPreferences.getInstance();
// create new theme controller, which will get the currently selected from shared preferences
@SonPatrick
SonPatrick / app.js
Created April 21, 2023 08:57 — forked from 3mrdev/app.js
Deploy Flutter Web App in a SharedHosting using NodeJs
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var app = express();
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
@SonPatrick
SonPatrick / index.js
Created March 14, 2023 10:34 — forked from khaosdoctor/index.js
Simple bitcoin-like proof of work using worker threads
const { payloads } = require('./payloads.json')
const { Worker } = require('worker_threads')
const LEADING_ZEROES = 4
const final = []
let finishedWorkers = 0
for (let payload of payloads) {
const worker = new Worker('./worker.js', { env: { LEADING_ZEROES } })
worker.once('message', (message) => {
@SonPatrick
SonPatrick / how-to-install-openssl-1.1.1-on-centos-7.md
Created October 20, 2022 19:23
How to install openssl 1.1.1 on CentOS 7

How To Install OpenSSL 1.1.1 on CentOS 7

This tutorial goes through how to install openssl 1.1.1 on CentOS 7, since the yum repo only installs up to openssl 1.0.

Requirements

Upgrade the system

yum -y update
@SonPatrick
SonPatrick / schedule.go
Created June 10, 2022 21:51 — forked from WesleiRamos/schedule.go
A simple match schedule algorithm
package main
import "fmt"
func main() {
times := []string{"Corinthians", "Londrina", "Operário", "Leicester"}
calendario := [][][]string{}
lenTimes := len(times)
lenTimes2 := lenTimes / 2
@SonPatrick
SonPatrick / git-deployment.md
Created March 17, 2022 17:52 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.