Skip to content

Instantly share code, notes, and snippets.

View aminembarki's full-sized avatar
🌍
Digital Nomad

Amine Mbarki aminembarki

🌍
Digital Nomad
View GitHub Profile
@aminembarki
aminembarki / 🌱 Permaculture chatgpt Prompt Idea
Created September 2, 2023 11:00
🌱 Permaculture chatgpt Prompt Idea
Given the specific land details and goals in the provided JSON, can you offer a detailed permaculture design, including soil preparation, irrigation strategies, and the integration of native plants for a sustainable ecosystem in Oujda, Morocco?
finally draw ascii schema
{
"landDetails": {
"area": "3 hectares",
"location": "Oujda, Morocco",
"coordinates": {
"NW": [34.12345, -6.54321],
@aminembarki
aminembarki / README.md
Created February 26, 2021 10:22 — forked from arikfr/README.md
Setting up HTTPS with LetsEncrypt for Redash Docker Deployment
  1. Make sure the domain you picked points at the IP of your Redash server.
  2. Switch to the root user (sudo su).
  3. Create a folder named nginx in /opt/redash.
  4. Create in the nginx folder two additional folders: certs and certs-data.
  5. Create the file /opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
    upstream redash {
        server redash:5000;
    }
    
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@aminembarki
aminembarki / carousel.js
Created December 18, 2018 12:20 — forked from alexcarpenter/carousel.js
Craft CMS carousel component
if('speechSynthesis' in window){
var speech = new SpeechSynthesisUtterance('hello baby');
speech.lang = 'en-US';
speech..rate = 1.5;
window.speechSynthesis.speak(speech);
}
@aminembarki
aminembarki / wget-snapshotpage.md
Created July 16, 2017 11:35 — forked from dannguyen/wget-snapshotpage.md
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

@aminembarki
aminembarki / mysql-docker.sh
Created April 4, 2017 20:29 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
@aminembarki
aminembarki / 0_backup_server.md
Created April 26, 2016 15:47 — forked from francois-blanchard/0_backup_server.md
Backup server with gem Backup and Whenever

Backup server with gem Backup and Whenever

Config Backup

Install backup gem

$ gem install backup

Generate Backup files see doc for genrate's options

@aminembarki
aminembarki / install Ruby 2.1.4 on Ubuntu 14.04
Created April 26, 2016 15:01
install Ruby 2.1.4 on Ubuntu 14.04
** First of all, install the prerequisite libraries: **
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
** Then install rbenv, which is used to install Ruby: **
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL