Skip to content

Instantly share code, notes, and snippets.

View superbiche's full-sized avatar
🕹️
Working from everywhere

Michel Tomas superbiche

🕹️
Working from everywhere
View GitHub Profile
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/usr/local/share/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="pygmalion"
#!/bin/sh
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")"
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
@superbiche
superbiche / nginx.conf
Created May 1, 2018 16:35 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@superbiche
superbiche / how-to-set-up-stress-free-ssl-on-os-x.md
Created February 28, 2018 12:06 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@superbiche
superbiche / backup-restore-android.sh
Created August 21, 2017 14:27
Backup/Restore Android phone with ADB
# Backup
adb backup -apk -shared -all 20170821-backup.ab
# Restore
adb restore 20170821-backup.ab
OnePlus 5 root
Table of content
How to Unlock Bootloader on OnePlus 5
OnePlus 5 TWRP download and guide
OnePlus 5 Root Guide
Well, some good news here, folks! The OnePlus 5 root is now available, meaning you can now gain superuser access on the OP5, and use your favorite root apps for some supercool stuff right away.
The OnePlus 5 root is available thanks to TWRP recovery for the device becoming available today, which is what you need to install first in order to gain root access.
@superbiche
superbiche / mysql_all_tables_size.sql
Created August 8, 2017 08:52
Get all dbs' tables size
SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC;
@superbiche
superbiche / mysql_tables_size.sql
Created August 8, 2017 08:51
Get a db's tables size
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "$DB_NAME";
diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
index 1db8da7f72..70db28549c 100644
--- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
+++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
@@ -268,27 +268,41 @@ protected function leftQuery($options) {
// In the meantime, this works, but with a leap of faith.
$orders = &$subquery->getOrderBy();
foreach ($orders as $order_key => $order) {
- // But if we're using a whole view, we don't know what we have!
- if ($options['subquery_view']) {
@superbiche
superbiche / INSTALL.rst
Created April 30, 2017 00:29 — forked from jensens/INSTALL.rst
sentry setup with docker-compose

In order to run this image do: docker-compose up -d to get all up. On first run DB initialization and initial user setup is done like so:

First start a bash in the container: docker-compose exec sentry /bin/bash. Then, inside bash, do sentry upgrade wait until it asks you for an inital user. When finished exit the bash.

When in doubt check with docker-compose ps if all went fine.