Clean up SilverStripe ModelAdmin (no sidebar, no filter, no import, no print)
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
# I managed to get the compiled version with patched QT working on ubuntu precise 64bit (12.04 LTS) and thought I'd share my bash history in the hopes it might spare others some trouble shooting. | |
# Also note that this install process takes rather long, you might want to consider running it in a screen or something | |
# you will be needing git if you haven't got it yet | |
sudo apt-get install git-core | |
# as per installation instructions, install dependencies for wkhtmltopdf | |
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev | |
# clone the repo | |
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf |
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: mysite/code/TranslatableControllerExtension.php | |
class TranslatableControllerExtension extends Extension { | |
/** | |
* save the current controller to ensure we have access to it, | |
* this is necessary because Security crates a fake Page_Controller to render templates | |
* @var Controller | |
*/ | |
protected static $actual_current_controller; |
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 | |
/** | |
* @author Zauberfisch | |
* @method ManyManyList Products() | |
*/ | |
class ProductCategoryPage extends Page { | |
private static $many_many = array( | |
'Products' => 'Product', | |
); |
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 | |
class Page extends SiteTree { | |
private static $many_many = array( | |
'RelatedPages' => 'Page', | |
); | |
// be careful to name the many_many_extraField something that does not conflict with existing DB fields. | |
// eg: 'Sort' already exists on class SiteTree, so using that will get you into trouble. | |
private static $many_many_extraFields = array( | |
'RelatedPages' => 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
ErrorDocument 404 /assets/error-404.html | |
ErrorDocument 500 /assets/error-500.html | |
<Files *.ss> | |
Order deny,allow | |
Deny from all | |
Allow from 127.0.0.1 | |
</Files> | |
<Files web.config> |
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 | |
/** | |
* @author zauberfisch | |
*/ | |
class BaseValidator extends Validator { | |
protected $validateFields, $requireFields; | |
/** | |
* @param bool|string[]|\FormField[]|\FieldList $validateFields |
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 | |
/* | |
class MyDataObject extends DataObject { | |
private static $db = [ | |
'FoobarCountryCode' => 'Varchar', | |
'FoobarAreaCode' => 'Varchar', | |
'FoobarPhoneNumber' => 'Varchar', | |
'FoobarExtension' => 'Varchar', | |
]; |
Switching window focus ($mod+Up
/ $mod+Right
/ $mod+Down
/ $mod+Left
) in i3 cycles through all windows on a workspace, meaning when you hit one edge of the screen, it will start again on the other side.
I was looking for a way to disable that, but was unable to find a way to change this via configuration. Therefore I have created the following script.
Place i3-focus-nowrap.sh
somewhere within your path (eg /usr/local/bin
) or use an absolute reference in the keybindings below.
And replace the keybindings in your .i3 config (eg ~/.i3/config
)