Skip to content

Instantly share code, notes, and snippets.

View Luxian's full-sized avatar
🐢
superhero with no power or motivation

Lucian NEAG Luxian

🐢
superhero with no power or motivation
View GitHub Profile
@Luxian
Luxian / notes.md
Created March 16, 2024 06:14
Samsung S5e debloating
@Luxian
Luxian / c14n-slow-on-generated-dom-testcase.php
Last active April 15, 2019 09:29
DOMNode::C14N() is way slower on created DOMDocuments than loaded ones
<?php
/**
* This code demonstrates the performance difference when calling
* DOMNode::C14N() on a generated DOMDocument versus on a DOMDocument that was
* loaded from a string.
*
* Calling DOMDocument::normalizeDocument() doesn't make any difference.
*
* Output example:
* Testing with 500 items
<?php
class Shell {
public $command;
public $output_array;
public $output;
public $exit_code;
public function __construct($command, $exit_code, array $output_array) {
@Luxian
Luxian / randomize-mac-wifi.sh
Created February 14, 2018 07:00
Randomize MAC address for Macbook Pro's WiFi card to bypass traffic limitation imposed by some hotels
#!/usr/bin/env bash
# Randomize MAC address for the WiFi cards on Macbook Pro
#
# Most of the code comes from here:
# https://apple.stackexchange.com/questions/151986/change-mac-address-in-os-x-yosemite
#
echo "Randomizing WiFi MAC address...";
echo;
@Luxian
Luxian / keybase.md
Last active September 19, 2017 08:17

Keybase proof

I hereby claim:

  • I am luxian on github.
  • I am luxian (https://keybase.io/luxian) on keybase.
  • I have a public key ASDeIDnmni2OVF-zEmAL01vIvXWtCKKLw_fW3l8PPTbybAo

To claim this, I am signing this object:

@Luxian
Luxian / mount.sh
Created February 20, 2017 10:25
Script that mounts a VirtualBox share in Linux guest VMs
#!/bin/bash
# Target directory
DIRECTORY=~/Desktop/vboxshare
# Folder name (from VirtualBox share folders settings)
FOLDER_NAME="share";
# Make sure the directory exists
if [ ! -d "$DIRECTORY" ]; then
<?php
if (!getenv('AMAZEEIO_SITE_URL')) {
/**
* These settings are used only outside vagrant
*/
/**
* The local domain for the website. It might contain port number
@Luxian
Luxian / paragraph-cleanup.drush
Last active March 10, 2016 16:31
Cleanup for Drupal 8 paragrah translation
#!/usr/bin/env drush
#<?php // trigger phpStorm syntax
/**
* @revision: 2
*
* @file
* Drush script to fix Drupal 8 paragraph content translation.
*
* This script was meant to be run after the following patch was applied to
* paragraphs:
@Luxian
Luxian / example.php
Created January 13, 2015 17:03
Check what nodequeues are used in views
<?php
/**
* Check what nodequeues are used in views
*
* Usage:
* drush ev "luxian_nodequeue_stats();"
*/
function luxian_nodequeue_stats() {
if (!drupal_is_cli()) {
@Luxian
Luxian / check_redirect.php
Created March 19, 2014 08:31
Helper function to check if a page redirects correctly
<?php
/**
* Get redirect information for a given URL
*
* @param string $url
* URL to check
*
* @return array
* In case of success complete cURL info array returned by curl_getinfo() +