Skip to content

Instantly share code, notes, and snippets.

View peterlozano's full-sized avatar

Pedro Lozano peterlozano

View GitHub Profile
export PATH := ./node_modules/.bin:$(PATH)
build: prebuild scripts styles markup
clean:
rimraf dist/*
prebuild: clean
scripts:
#!/bin/sh
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80

Keybase proof

I hereby claim:

  • I am peterlozano on github.
  • I am peterlozano (https://keybase.io/peterlozano) on keybase.
  • I have a public key whose fingerprint is 36F0 13D0 FF2B A37F F269 CB29 29B9 A9F6 5110 D287

To claim this, I am signing this object:

<?php
$module = 'module_name';
$name = 'table_name';
$table = drupal_get_module_schema($module, $name);
db_create_table($name, $table);
<?php
// For field of type datestamp
db_insert('table')
->fields(array(
'created' => date_create()->format('Y-m-d H:i:s'),
))
->execute();
@peterlozano
peterlozano / drupal_8_send_email.php
Created June 23, 2016 14:03
Sending mail from drupal 8
<?php
// To be passed to hook_mail
$params = array();
// To be passed to hook_mail
$key = 'my_mail_key';
$langcode = \Drupal::languageManager()->getDefaultLanguage();
\Drupal::service('plugin.manager.mail')
@peterlozano
peterlozano / drupal_8_create_node_url.php
Last active June 24, 2016 18:33
Create absolute link to node in D8
<?php
$url = \Drupal\Core\Url::fromRoute('entity.node.canonical', array('node' => $nid), array('absolute' => TRUE))->toString();
@peterlozano
peterlozano / node_user.php
Last active July 8, 2016 09:40
Drupal 8: Get user entity for node author
<?php
$user = $node->uid->entity;
$email = $node->uid->entity->mail->value;
# https://stackoverflow.com/questions/32431465/mamp-ssl-error-error14077410ssl-routinesssl23-get-server-hellosslv3-alert
1. brew install openssl
2. Download and unpack the latest cURL
3. In the cURL source directory:
LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" ./configure --prefix=/Applications/MAMP/Library/
4. make
5. make install
6. Restart MAMP