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 | |
/** | |
* Implements hook_menu_alter(). | |
*/ | |
function familink_custom_menu_alter(&$items) { | |
$items['user/%user/cancel']['access callback'] = 'familink_custom_user_admin_access'; | |
$items['user/%user/cancel']['access arguments'] = array(1, 'user_cancel_access'); | |
$items['user/%user/cancel/confirm/%/%']['access callback'] = 'familink_custom_user_admin_access'; |
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 | |
# Put this file to any your local $PATH directory. | |
let n=$((`nproc` - 1)) | |
if [[ $(cpufreq-info --governors) =~ $1 ]] | |
then | |
for i in `seq 0 $n` | |
do | |
`sudo cpufreq-set -c $i -g $1` | |
done |
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 | |
FILE="$HOME/Dropbox/Public/screenshot/screenshot-$(date +%F_%H:%M:%S).png" | |
import $FILE && dropbox sharelink $FILE | parcellite -c | |
# Or use xclip instead of parcellite | |
# import $FILE && dropbox puburl $FILE | xclip -selection clipboard | |
# For Kde4 & Klipper use this bash-script | |
# https://github.com/milianw/shell-helpers/blob/master/clipboard |
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
.filefield-source.filefield-source-reference { | |
float: right; | |
overflow: hidden; | |
} | |
.filefield-source.filefield-source-reference > .form-item { | |
padding: 0; | |
} |
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 | |
# Switch PulseAudio master channel between multiple sound cards | |
ENABLED=$(pacmd list-sinks | grep -A1 '* index' | grep 'name' | awk '{print $2}' | tr -d '<->') | |
DEVICE=$(pacmd list-sinks | grep 'name:' | awk '{print $2}' | tr -d '<->' | grep -v $ENABLED) | |
pactl set-default-sink $DEVICE | |
pactl set-default-source "$DEVICE.monitor" | |
INPUTS=($(pacmd list-sink-inputs | grep index | awk '{print $2}')) | |
for i in ${INPUTS[*]}; do pacmd move-sink-input $i $DEVICE &> /dev/null; done | |
qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.setCurrentMaster "PulseAudio::Playback_Devices=:1" "$DEVICE" 2>&1 > /dev/null |
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
(function($) { | |
$(document).ready() { | |
var $forms = $('form'); | |
$forms.find(':radio').change(function() { | |
var sisyphus = Sisyphus.getInstance(); | |
var name = $(this).attr("name"); | |
var $form = $(this).parents('form'); | |
if (!$form.find(':radio[name="' + name + '"]:checked').length) { | |
var prefix = (sisyphus.options.locationBased ? sisyphus.href : "") + $form.attr("id") + $form.attr("name") + name + sisyphus.options.customKeySuffix; | |
sisyphus.saveToBrowserStorage(prefix, '', 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 | |
/** | |
* @file | |
* Provide sql expression where the value between columns | |
* | |
* @copyright Copyright (c) 2014 HTML&CMS (http://html-and-cms.com) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace HTMLandCMS\Db\Sql\Predicate; |
NewerOlder