This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Obviously change name and pass values and example.com domain | |
curl --insecure \ | |
--cookie ./cookie.txt \ | |
--cookie-jar ./cookie.txt \ | |
-e example.com \ | |
-d "name=admin" \ | |
-d "pass=admin" \ | |
-d "form_id=user_login" \ | |
https://example.com/user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Get IP address from latest docker instance | |
exec docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure you have pv and zcat already installed | |
pv my_database.sql.gz | zcat | drush sqlc | |
# Example output: | |
# 433kB 0:00:00 [ 658kB/s] [============================================================================================>] 100% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
drush -y sql-dump --structure-tables-key=common --gzip --result-file=path/based/on/drupal/root/to/your/backup.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function blue_get_block($module, $delta, $subject = '') { | |
$block = new stdclass; // empty object | |
$array = module_invoke($module, 'block', 'view',$delta ); | |
// must be converted to an object | |
// @see block_list() | |
if (isset($array) && is_array($array)) { | |
foreach ($array as $k => $v) { | |
$block->$k = $v; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function user_is_editor() { | |
global $user; | |
if(in_array(array('employee editor', 'administrator'), $user->roles) || $user->uid == 1) { | |
return TRUE; | |
} else { | |
return FALSE; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* General utility variables: | |
* - $base_path: The base URL path of the Drupal installation. At the very | |
* least, this will always default to /. | |
* - $css: An array of CSS files for the current page. | |
* - $directory: The directory the template is located in, e.g. modules/system | |
* or themes/garland. | |
* - $is_front: TRUE if the current page is the front page. Used to toggle the mission statement. | |
* - $logged_in: TRUE if the user is registered and signed in. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* overwrite all links with extra subkultura _GET parametr | |
* This is usefull for people that send link over IM's | |
* @param type $path | |
* @param type $options | |
* @param type $original_path | |
*/ | |
function custom_url_rewrite_outbound(&$path, &$options, $original_path) { | |
if(isset($_SESSION['subculture'])) { | |
if(!empty($options['query'])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<config> | |
<!-- Sources --> | |
<sources ignoredDirs="CVS:.svn:tmp:.git:.hg:.bzr"> | |
<source name="drupal" scanPath="/var/www/versions/phoenix109-piotrek" documentRoot="/var/www/versions/phoenix109-piotrek" basePath="/" /> | |
</sources> | |
<!-- Servers --> | |
<servers> | |
<server name="rackspace" transporter="cumulus"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo easy_install Pygments | |
$ alias c='pygmentize -O style=monokai -f console256 -g' |
OlderNewer