This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dart is a C-Like strongly static typed language | |
// variable are pass-reference-by-value | |
// Everything is an Object | |
/* | |
* Data Type in Dart | |
Data Type | Keyword | Description | |
Number | int, double, num | Numbers in Dart are used to represent numeric literals | |
Strings | String | Strings represent a sequence of characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Docker 20.10.7 on Ubuntu 20.04 focal | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
# This is for amd64_x86 architecture (checkout for other architectures: https://docs.docker.com/engine/install/ubuntu/) | |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grapes([ | |
@Grab('org.slf4j:slf4j-simple:1.7.25'), | |
@Grab('io.github.http-builder-ng:http-builder-ng-okhttp:1.0.4') | |
]) | |
import groovyx.net.http.OkHttpBuilder | |
import groovyx.net.http.OkHttpEncoders | |
import groovyx.net.http.MultipartContent | |
import static groovyx.net.http.HttpBuilder.configure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
You should first install phpml library with composer: | |
``` | |
composer require php-ai/php-ml | |
``` | |
then create in the same directory of vendor a file (e.g. `index.php`) with this content. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$users = file_get_contents('https://jsonplaceholder.typicode.com/users'); | |
$gz = base64_encode(gzencode($users)); | |
if (!$gz){ | |
die('content contains non base64 alpha'); | |
} | |
echo $gz; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Groovy from/to Json conversion | |
import groovy.json.* | |
// Object to Json | |
class Version { | |
int id | |
} | |
class User { | |
String className = this.class.simpleName.toLowerCase() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script allows to upgrade postgres database server (e.g. 9.5 to 9.6) | |
# References: | |
#https://gorails.com/guides/upgrading-postgresql-version-on-ubuntu-server | |
#https://stackoverflow.com/questions/13733719/postgresql-which-version-of-postgresql-am-i-running/54514786#54514786 | |
#https://stackoverflow.com/questions/46687645/upgrade-postgresql-from-9-6-to-10-0-on-ubuntu-16-10 | |
#https://stackoverflow.com/questions/47029055/how-do-i-upgrade-my-postgresql-9-5-to-postgresql-10-on-ubuntu-16-04 | |
#https://askubuntu.com/questions/831292/how-do-i-install-postgresql-9-6-on-any-ubuntu-version | |
#https://chartio.com/resources/tutorials/how-to-view-which-postgres-version-is-running/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, csv, requests, datetime, urllib, re | |
from bs4 import BeautifulSoup | |
# from dateutil.parser import parse # if you want to parse datetime | |
# This script allows you to grab results from your wordpress website if you're using "Quiz And Survey" plugin. | |
wp_host = 'https://your-wordpress-website.com' | |
wp_login = f"{wp_host}/login" | |
wp_admin = f"{wp_host}/wp-admin/" | |
wp_quiz = f"{wp_host}/wp-admin/admin.php?page=mlw_quiz_results&qmn_order_by=time_taken_real" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* VolleySingleton | |
* | |
* This is just a wrapper around [VolleyPlus](https://github.com/DWorkS/VolleyPlus) library (tested with v0.1.4) | |
* You can update the UI without using AsyncTask neither runOnUiThread | |
* It comes with caching and full image caching without third party library, included options to clear cache | |
* It doesn't depend on any other libraries and you can send any type of request (String, JSON...) | |
* It works for both Java and Groovy (it should works for Kotlin as well) | |
* Tested on SdkVersion v19 up to v28. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original source: https://openmp.llvm.org/ | |
# 1- Clone the repo (~ 1Gb) | |
git clone --depth 1 https://github.com/llvm/llvm-project.git | |
cd llvm-project | |
mkdir build && cd build | |
# 2- Make sure clang & clang++ are both installed (I believe xcode should be installed as well), you'll some space (~ 16Gb) | |
cmake ../llvm -DLLVM_ENABLE_PROJECTS=openmp -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) | |
make | |
# 3- (Optional) Running tests | |
make check-all |