Skip to content

Instantly share code, notes, and snippets.

View claudiainbytes's full-sized avatar

Claudia Estupiñán Forero claudiainbytes

View GitHub Profile
@claudiainbytes
claudiainbytes / gist:d9c9d84fa16d4afcf488086711082e98
Last active December 6, 2018 22:54
Drupal 8 Image Style using Twig
# Example 1.
<div class="col-md-8 blog--caja-right">
{% set imageblog = {
'#theme': 'image_style',
'#style_name': 'despliegue_blog',
'#uri': node.field_image.entity.uri.value,
'#attributes': { class: 'img-responsive' },
} %}
{{ imageblog }}
@claudiainbytes
claudiainbytes / Operaciones-Git
Created August 19, 2018 21:01 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@claudiainbytes
claudiainbytes / gist:08ec5fb1d0dc3d6feff66b69cc00be83
Created May 18, 2018 23:44
React Short-circuit Evaluation Syntax
{this.state.screen === 'list' && (
<ListContacts
contacts={this.state.contacts}
onDeleteContact={this.removeContact}
/>
)};
{this.state.screen === 'create' && (
<CreateContact />
)}
/* Combining .filter() and .map()
*
* Using the musicData array, .filter, and .map():
* - filter the musicData array down to just the albums that have
* sold over 1,000,000 copies
* - on the array returned from .filter(), call .map()
* - use .map() to return a string for each item in the array in the
* following format: "<artist> is a great performer"
* - store the array returned form .map() in a new "popular" variable
*
/* Using .filter()
*
* Using the musicData array and .filter():
* - return only album objects where the album's name is
* 10 characters long, 25 characters long, or anywhere in between
* - store the returned data in a new `results` variable
*
* Note:
* - do not delete the musicData variable
* - do not alter any of the musicData content
/* Using .map()
*
* Using the musicData array and .map():
* - return a string for each item in the array in the following format
* <album-name> by <artist> sold <sales> copies
* - store the returned data in a new albumSalesStrings variable
*
* Note:
* - do not delete the musicData variable
* - do not alter any of the musicData content
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="container" id="app">
<div class="row">
@claudiainbytes
claudiainbytes / gist:bc1f3f9e21e80f488c0518f8c480553f
Last active February 4, 2018 19:18
SSL certificates: Subject alternative names (SAN) solution for XAMPP
#https://gist.github.com/nrollr/4daba07c67adcb30693e
1. Make a directory called xamppcerts in etc folder
mkdir xamppcerts
2. Create the following file called localhost.conf
[req]
default_bits = 1024
@claudiainbytes
claudiainbytes / gist:1407f3ed15df9e9823758d4a96ecf6d6
Last active February 10, 2019 11:59
openssl for mac osx xampp
#open ssl
sudo openssl genrsa -out localhost.key 2048
sudo openssl req -new -x509 -key localhost.key -out localhost.crt -days 3650 -subj /CN=localhost
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain localhost.crt
...
#http-ssl.conf
SSLCertificateFile "/Applications/XAMPP/xamppfiles/etc/localhost.crt"
#SSLCertificateFile "/Applications/XAMPP/xamppfiles/etc/ssl.crt/server.crt"
....
SSLCertificateKeyFile "/Applications/XAMPP/xamppfiles/etc/localhost.key"
####### Apache Installation
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install httpd
#Now we just need to configure things so that our new Apache server is auto-started
sudo brew services start httpd
#You can see Apache running on the browser by default http://localhost:8080