Skip to content

Instantly share code, notes, and snippets.


José Luis SalahAdDin

View GitHub Profile
SalahAdDin /
Created Apr 4, 2017
Trying to make a custom template tag.
import logging
import re
import requests
from django.conf import settings
from django.template import Library
from django.template import Node
from django.template import TemplateSyntaxError
from django.utils.html import format_html_join
View dev-server.js
// Creates a hot reloading development environment
const path = require('path');
const express = require('express');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const DashboardPlugin = require('webpack-dashboard/plugin');
const config = require('./config/webpack.config.development');
SalahAdDin /
Last active Jan 16, 2018
Supply EC2 instances for works with Docker

NOTE: For install all docker: curl -sSL | sh.

  1. Update the system and prepare requirements:
    $ curl -sL | sudo -E bash -
    $ sudo apt-get update && sudo apt-get upgrade && sudo apt-get install apt-transport-https ca-certificates git  
    $ sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  1. Open next file and clean it:
    $ sudo nano /etc/apt/sources.list.d/docker.list
  2. Add proper source list, in this case Ubuntu 16.04 server, save and close:
SalahAdDin / DockerFile
Created Sep 17, 2016
Django + Docker + Postgres + ElasticSearch + Redis recipe
View DockerFile
FROM python:3.5.2
RUN apt-get update \
&& apt-get install -y gettext curl sudo \
&& curl -sL | sudo -E bash - \
&& apt-get install -y nodejs \
&& apt-get install -y libpng-dev libtiff5-dev libjpeg62-turbo-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk \
libopenjpeg-dev pngquant libmagickwand-dev imagemagick \
&& apt-get autoremove -y --purge \
SalahAdDin /
Created Aug 9, 2016
Installing elasticsearch in Antergos

Install ElasticSearch in Antergos require the next steps:

  1. Install from community repository: sudo pacman -S elasticsearch
  2. Enable ElasticSearch service: sudo systemctl enable elasticsearch
  3. Start ElasticSearch service: sudo systemctl start elasticsearch
  4. Some tweaks configuration:
    a. Change local networks:
    • Open config file: sudo vi /etc/elasticsearch/elasticsearch.yml
    • Uncomment and change this line: localhost
      b. Enable cross origin acces:
SalahAdDin /
Last active May 29, 2022
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification here.
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. Enter in super user mode with su - and then do echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk
View Mod para descargar.!
SalahAdDin / _date-dropper.scss
Last active Jun 24, 2016
Arreglos para time y date dropper.
View _date-dropper.scss
$black_5: rgba(0,0,0,0.05);
$color_lochmara_approx: #08c;
$color_mine_shaft_approx: #333;
$color_lochmara_45_approx: rgba(0, 136, 204, 0.45);
$white: #ffffff;
$color_pattens_blue_approx: #e3f2fa;
$font_0: dd-icon;
SalahAdDin / webpack.babel.config,js
Created Apr 26, 2016
Django jet statics compiler config.
View webpack.babel.config,js
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var COMMON_SCSS_PATH = './scss';
var COMMON_CSS_PATH = './css';
function fileList(dir) {
SalahAdDin / Installing Arch Linux
Last active May 16, 2019
Custom arch linux installation
View Installing Arch Linux
sudo pacman -Syyu
sudo pacman -S noto-fonts-emoji docker python-pip python-virtualenv python-numpy vlc variety inkscape krita linux-headers nodejs npm opera nginx postgresql pgadmin4 postgresql-old-upgrade postgresql-docs postgresql-libs elasticsearch clang ttf-aboriginal-sans
sudo pacman -S llvm firefox-i18n-es-mx firefox-i18n-es-ar firefox-i18n-tr wxpython openmp ttf-freefont lua-socket tk sane
sudo pacman -S postgis gdal hdf5 libreoffice-extension-writer2latex libreoffice-extension-texmaths libreoffice-fresh-ar libreoffice-fresh-eu libreoffice-fresh-tr yarn yay code opencv
yay -S hunspell-tr hunspell-ar rar libreoffice-extension-libregreek libreoffice-extension-dictionaries-es libreoffice-extension-languagetool libreoffice-extension-writer2epub spotify kitekatic gitkraken
sudo pacman -S noto-fonts-emoji deepin-voice-recorder deepin-grub2-themes docker zsh opera-ffmpeg-codecs python-pip python-virtualenv vlc variety neofetch inkscape krita 0ad gedit-plugins gparted linux-headers 0ad-data nodejs npm oper