Skip to content

Instantly share code, notes, and snippets.

View walidsa3d's full-sized avatar

Walid Saad walidsa3d

  • Freelancer
  • Tunisia
View GitHub Profile
@walidsa3d
walidsa3d / web-servers.md
Created January 18, 2020 13:12 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
// We'll use Puppeteer is our browser automation framework.
const puppeteer = require('puppeteer');
// This is where we'll put the code to get around the tests.
const preparePageForTests = async (page) => {
// Pass the User-Agent Test.
const userAgent = 'Mozilla/5.0 (X11; Linux x86_64)' +
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36';
await page.setUserAgent(userAgent);
@walidsa3d
walidsa3d / install_postgresql9.4_postgis2.1_ubuntu.md
Created December 3, 2017 10:48 — forked from ansell/install_postgresql9.4_postgis2.1_ubuntu.md
Installing PostgreSQL 9.4 and PostGIS on Ubuntu 14.04

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
@walidsa3d
walidsa3d / postgres_to_redshift.py
Created September 16, 2017 23:41 — forked from praveen-udacity/postgres_to_redshift.py
Postgres 2 Redshift Operator - Interview Code Review
import logging
import unicodecsv
from datetime import datetime as dt
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from airflow.exceptions import AirflowException
from airflow.hooks.postgres_hook import PostgresHook
from airflow.plugins_manager import AirflowPlugin
from psycopg2.extras import DictCursor
@walidsa3d
walidsa3d / trigger.py
Created September 16, 2017 23:33 — forked from IceS2/trigger.py
from airflow import DAG
from airflow.operators import PythonOperator, TriggerDagRunOperator
from datetime import datetime, timedelta
import sys
sys.path.append('/home/pablo/workspace/scratch/')
from default_test import default_test
default_args = {
'owner': 'airflow',
'depends_on_past': False,
@walidsa3d
walidsa3d / airflow-supervisord.conf
Created June 27, 2017 09:23 — forked from criccomini/airflow-supervisord.conf
airflow-supervisord.conf
; Configuration for Airflow webserver and scheduler in Supervisor
[program:airflow]
command=/bin/airflow webserver
stopsignal=QUIT
stopasgroup=true
user=airflow
stdout_logfile=/var/log/airflow/airflow-stdout.log
stderr_logfile=/var/log/airflow/airflow-stderr.log
environment=HOME="/home/airflow",AIRFLOW_HOME="/etc/airflow",TMPDIR="/storage/airflow_tmp"
@walidsa3d
walidsa3d / Project Amazon Fine Food Reviews.ipynb
Created June 18, 2017 04:30 — forked from abhigrover101/Project Amazon Fine Food Reviews.ipynb
Sentiment Classification : Amazon Fine Food Reviews Dataset
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walidsa3d
walidsa3d / understanding-word-vectors.ipynb
Created June 18, 2017 04:22 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,
@walidsa3d
walidsa3d / elasticsearch-cheatsheet.txt
Created April 8, 2017 14:57 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}