😶🌫️
This file contains hidden or 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 | |
| # Download random wallpaper from desktoppr.co | |
| # Save this file: | |
| # $ curl -s https://gist.githubusercontent.com/zviryatko/055f8f4850bf17323c4f127a4daeccdf/raw/random-wallpaper.sh > $HOME/.local/bin/random-wallpaper | |
| # $ chmod a+x $HOME/.local/bin/random-wallpaper | |
| # $ crontab -e | |
| # and add this line to the end: | |
| # */20 * * * * $HOME/.local/bin/random-wallpaper | |
| IMG_PATH="$HOME/.cache/wallpaper.jpg" | |
| curl -s `curl -s https://api.desktoppr.co/1/wallpapers/random | python -c "import json,sys; obj=json.load(sys.stdin); print obj['response']['image']['url'];"` > $IMG_PATH |
This file contains hidden or 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 | |
| /** | |
| * Added custom metaboxes to post types on admin init action. | |
| */ | |
| function dummy_add_metabox() { | |
| add_meta_box("metabox-id", "Metabox name", "dummy_metabox_function", "page"); | |
| } | |
| add_action("admin_init", "dummy_add_metabox"); | |
| function dummy_custom_fields() { | |
| return array( |
This file contains hidden or 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 | |
| /** | |
| * Added custom metaboxes to post types on admin init action. | |
| */ | |
| function dummy_add_metabox() { | |
| add_meta_box("metabox-id", "Metabox name", "dummy_metabox_function", "page"); | |
| } | |
| add_action("admin_init", "dummy_add_metabox"); |
This file contains hidden or 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"?> | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
| <fontconfig> | |
| <!-- Helvetica is a non true type font, and will look bad. This | |
| replaces it with whatever is the default sans-serif font --> | |
| <match target="pattern"> | |
| <test name="family" qual="any"> | |
| <string>Helvetica</string> | |
| </test> | |
| <edit mode="assign" name="family"> |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import pygtk | |
| pygtk.require('2.0') | |
| import gtk | |
| import os | |
| class DoTheLogOut: | |
| # Close window |
This file contains hidden or 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 | |
| /** | |
| * @file | |
| * Contains \Drupal\custom_user\Routing\RouteSubscriber. | |
| * | |
| * Put this file in "src/Routing" module directory. | |
| */ | |
| namespace Drupal\custom_user\Routing; |
This file contains hidden or 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 | |
| use \Drupal\user\UserInterface; | |
| use \Drupal\Component\Utility\Random; | |
| /** | |
| * Implements hook_ENTITY_TYPE_create(). | |
| */ | |
| function custom_user_user_presave(UserInterface $entity) { | |
| $entity->setUsername($entity->getEmail()); | |
| } |
This file contains hidden or 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 | |
| # mandatory | |
| tint2 & | |
| pcmanfm -d & | |
| # optional | |
| # set desktop background | |
| # pcmanfm --desktop & | |
| nitrogen --restore & |
This file contains hidden or 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
| function drush { | |
| DRUSH=$(which drush) | |
| PWD=$(pwd) | |
| if [ -f 'drush/drushrc.php' ]; | |
| then | |
| $DRUSH -c ./drush/drushrc.php "$@"; | |
| elif [ -d "$PWD/web" ]; | |
| then | |
| $DRUSH --root="$PWD/web" "$@"; | |
| else |
This file contains hidden or 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 | |
| /** | |
| * Implements hook_process_HOOK(). | |
| */ | |
| function custom_preprocess_breadcrumb(&$variables) { | |
| /** @var \Drupal\Core\Controller\TitleResolverInterface $title_resolver */ | |
| $title_resolver = \Drupal::service('title_resolver'); | |
| /** @var \Drupal\Core\Routing\CurrentRouteMatch $current_route */ | |
| $current_route = \Drupal::service('current_route_match'); |