Skip to content

Instantly share code, notes, and snippets.

View madeingnecca's full-sized avatar
🏠
Working from home

Damiano Seno madeingnecca

🏠
Working from home
  • Venice - Italy
View GitHub Profile
@madeingnecca
madeingnecca / semrush_print_hierarchy.js
Last active July 26, 2019 09:03
Semrush print hierarchy (source)
(function() {
var data = {}, html, url, i;
$('td.sa-sortingColumn a').each(function() {
var url = $.trim($(this).attr('title'));
data[url] = $(this).closest('tr').find('td.sa-ta-left a').map(function() {
return $(this).attr('href');
}).get();
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
projectname=$1
wget https://www.drupal.org/download-latest/zip -O drupal-latest.zip
unzip drupal-latest.zip -d $projectname
foldername=$(ls -1 $projectname)
mv $projectname/$foldername/* $projectname/
mv $projectname/$foldername/.* $projectname/
rm -rf $projectname/$foldername
@madeingnecca
madeingnecca / sitemap_crawler.php
Last active February 5, 2020 22:06
Crawl a sitemap.xml file using php
<?php
if (!isset($argv)) {
die("This script only works in cli mode.\n");
}
if (!isset($argv[1])) {
die("Usage: " . $argv[0] . " <SITE_URL>\n");
}
@madeingnecca
madeingnecca / faster_import_post.sql
Created September 29, 2017 07:45
[MYSQL] Faster import - POST
COMMIT;
SET unique_checks=1;
SET foreign_key_checks=1;
@madeingnecca
madeingnecca / faster_import_pre.sql
Created September 29, 2017 07:43
[MYSQL] faster import - PRE
SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;
@madeingnecca
madeingnecca / gist:d099358bfe4ebe598ea7e85914490f2f
Created August 31, 2017 13:33
Drupal install site via profile makefile
cd webroot
# Beware! When in windowws environment any error message will prevent all files from being copied to your desidered location!
drush make profiles/PROFILE/make/PROFILE.make -y
@madeingnecca
madeingnecca / d7_show_users_data.php
Last active March 20, 2019 20:46
DRUPAL 7 - db query to show users data
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
$result = db_query('SELECT * FROM users');
foreach($result as $item) {
@madeingnecca
madeingnecca / gist:63732ab6d12082d02684
Last active August 29, 2015 14:10
JS - bindForBusinessEvent
(function(root, name) {
function bind(fn, context) {
// Save original args, but remove the first 2 arguments (fn, context).
var outerArgs = Array.prototype.splice.call(arguments, 2);
return function() {
// Wipe out first argument, which is a "event" object.
var innerArgs = Array.prototype.splice.call(arguments, 1);
return fn.apply(context, innerArgs.concat(outerArgs));
}