Skip to content

Instantly share code, notes, and snippets.

View saade's full-sized avatar
🦒
Starting a new side-project using Filament ... probably

Guilherme Saade saade

🦒
Starting a new side-project using Filament ... probably
View GitHub Profile
@saade
saade / en-validation.json
Created September 20, 2020 20:20 — forked from diego3g/en-validation.json
Validation
{
"above": "The {{field}} should be above {{argument.0}}.",
"accepted": "The {{field}} should have been accepted",
"after": "The {{field}} should be a date after {{argument.0}}",
"after_offset_of": "The {{field}} should be after {{argument.0}} {{argument.1}} from today’s date",
"alpha": "The {{field}} should contain letters only",
"alpha_numeric": "The {{field}} should contain letters and numbers only",
"array": "The {{field}} should be an ARRAY.",
"before": "The {{field}} should be a date before {{argument.0}}.",
"before_offset_of": "The {{field}} should be before {{argument.0}} {{argument.1}} from today’s date",
@saade
saade / cluster.md
Created December 4, 2018 01:18 — forked from learncodeacademy/cluster.md
Node Cluster - Enhance your node app by using all the cores of your processor.

Here's all you have to do to add clustering to your node.js application.

  • save this code as cluster.js, and run cluster.js instead of server.js (or /bin/www, or whatever it's called for your project)
  • the only line you'll need to change is the last line - it needs to point to the location of your server.js file
var cluster = require('cluster');

if (cluster.isMaster) {
  // Count the machine's CPUs
 var cpuCount = require('os').cpus().length;
@saade
saade / gist:85a811ea2f09899f475a0f80068a9f5e
Created September 13, 2018 20:19
Make mysql accept emoji
# For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# For each column:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.)
@saade
saade / gist:20a054a22233c91f00843a12f0775160
Created September 13, 2018 20:19
Make mysql accept emoji
# For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# For each column:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.)
Step 1 – Add new repository sources
At the time of writing, PHP 7.0 hasn’t yet made the official repository sources, so we need to add one which provides us with the PHP 7.0 packages. Edit your sources file with this command:
sudo nano /etc/apt/sources.list
Below the existing entries in the file on a blank line, add the following two lines:
deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
#deb-src http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
Your file should look a little like this:
sudo mkdir /var/run/mysqld
sudo chmod 777 /var/run/mysqld
sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables &
mysql -uroot
use mysql;
update user set authentication_string=password('mynewpassword') where user='root';
flush privileges;
quit
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-add-repository "deb https://download.sublimetext.com/ apt/stable/"
sudo apt install sublime-text
#!/bin/sh
versionMaj="1"
versionMin="0"
versionRev="1"
version="$versionMaj.$versionMin-$versionRev"
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
# Android SDK setup
## Install Java
```
sudo apt-get update
sudo dpkg --add-architecture i386
sudo apt-get install libbz2-1.0:i386
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
sudo apt-get install openjdk-8-jdk openjdk-8-jre
javascript:( X_checkTest() )