Skip to content

Instantly share code, notes, and snippets.

View omarlopesino's full-sized avatar

Omar Mohamad - El Hassan Lopesino omarlopesino

  • Metadrop
  • Madrid
View GitHub Profile
@omarlopesino
omarlopesino / gist:6ac87974ba6e39de8a0b2ee730d0c05f
Created February 23, 2018 21:17
VUE JS: D3 - Move img around a path
<template>
<div>
<svg id="d3-container" width="2000" height="500">
<clipPath id="clipCircle">
<circle r="120" cx="170" cy="140"></circle>
</clipPath>
<g>
<image id="face" x="0" y="20" width="300" height="300" xlink:href="https://api.omarlopesino.me/sites/default/files/2018-02/me.jpeg" clip-path="url(#clipCircle)">
</image>
@omarlopesino
omarlopesino / discordbotapiai.py
Created June 21, 2018 12:12
Discord bot using api.ai to process messages
import discord
import asyncio
import apiai
import json
client = discord.Client()
// Api.ai access token.
CLIENT_ACCESS_TOKEN = 'access-token'
def query_apiai(query):
<?php
$paragraph_text = Paragraph::create([
'type' => 'text',
'field_text' => [
'value' => '
<h2>In this page you can publish the failures you consider people might learn of.</h2>
<p><a class="btn btn-primary text-center" href="/node/add/failure" title="Post your own failure!">Post your own failure!</a></p>
',
'format' => 'restricted_html'
@omarlopesino
omarlopesino / docker-compose.yml
Created January 28, 2019 16:55
Jenkins docker compose
version: '2'
services:
jenkins:
container_name: jenkins
image: 'jenkins/jenkins:lts'
ports:
- '80:8080'
- '443:8443'
- '50000:50000'
volumes:
@omarlopesino
omarlopesino / docker-compose.yml
Last active January 28, 2019 16:58
Docker compose Ngrok sample
version: '2'
services:
ngrok:
container_name: nginx_ngrok
image: wernight/ngrok
links:
- jenkins
environment:
#- NGROK_AUTH=<>
@omarlopesino
omarlopesino / docker-compose.yml
Last active May 6, 2019 06:34
Docker4drupal xdebug for cli and web
php:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
DB_HOST: $DB_HOST
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
@omarlopesino
omarlopesino / config.yaml
Last active March 29, 2019 20:27
DDev xdebug cli
xdebug_enabled: true
@omarlopesino
omarlopesino / drupal-version.sh
Created April 11, 2019 12:04
Get drupal version
DRUPAL_VERSION="$(drush status --format=list 'Drupal version' | cut -d. -f1 -)"