Skip to content

Instantly share code, notes, and snippets.

@chssweb
chssweb / Phpmyadmin-setup.md
Last active September 5, 2016 07:51
Puphpet setup

Note: Adminer is installed in this setup. If that, or Heidi or equivalent, does what you need then don't go any further.

** THIS IS A WORK IN PROGRESS - Not everything will work as expected **

The official Ubuntu repo install seems to break the apache setup. Fixable if you turn of the apache workflow module and turn on mpm-prefork, but not worth the hassle. And the git way is pretty easy.

Install

First two steps really should be done in the scripts as useful in the long run:

  • sudo chown vagrant:www-data -R /var/www/html
@chssweb
chssweb / readme
Created April 2, 2015 16:03
Sharepoint list form pagination
Add to a webpart script editor on the page the form is embedded.
@chssweb
chssweb / PuTTYPortableLinker.ico
Last active August 29, 2015 14:10
WinSCP Portable - Integration with Putty
AAABAAMAEBAQAAAAAAAoAQAANgAAACAgEAAAAAAA6AIAAF4BAAAwMBAAAAAAAGgGAABGBAAAKAAA
ABAAAAAgAAAAAQAEAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAA
gACAAICAAADAwMAAgICAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAeIiIiA
AAAAD///iIgAAAAAiIiIiAAAAAB4h3eAAAAAAPS0x4AAAAAA/EtIgAAAAAD8RLsAiIgAAPi7u7CI
iIAAAAC7u7CIgAAAAAu4h3gAAAAACEtMeAAAAAAPxLR4AAAAAA/MRHgAAAAAD///eAAAAAAAAAAA
AIB/AAAAPwAAAB8AAIAfAACAPwAAgD8AAIADAACAAQAAgAAAAMAAAAD8AQAA/AEAAPwBAAD8AQAA
/AEAAP4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAA
gAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAA
AAAAAAAAAAAAAAAAAAAHiIiIiIiIiIgAAAAAAAAAD3d3d3eAAAh4gAAAAAAAAA93d3d3d3d3eIgA
AAAAAAAP//////////eIAAAAAAAAAHAAAAAAAAB/iAAAAAAAAAAAeIiIiIiIB/gAAAAAAAAAAP//
@chssweb
chssweb / cmd.md
Last active July 29, 2016 15:14
Notepad++ run css-beatify node script on css in editor
@chssweb
chssweb / Commandline4VLC
Created September 23, 2014 14:30
VLC Desktop Capture
"D:\Portable_Apps\PortableApps\VLCPortable\App\vlc\vlc.exe" -vvv screen:// --screen-fps=10.000000 --live-caching=0 --sout="#transcode{vcodec=h264,vb=1200,fps=10,scale=1,acodec=none}:file{dst=outnew.mp4}" :sout-keep :screen-follow-mouse :screen-mouse-image=pointer.png
"D:\Portable_Apps\PortableApps\VLCPortable\App\vlc\vlc.exe" -vvv screen:// :screen-fps=10.000000 :live-caching=0 :screen-follow-mouse :screen-mouse-image=pointer.png :sout="#transcode{vcodec=h264,vb=1200,fps=10,scale=1,acodec=none}:file{dst=outnew.mp4}" :sout-keep
"D:\VLCPortable\App\vlc\vlc.exe" -vvv screen:// :screen-fps=10.000000 :live-caching=0 :screen-follow-mouse :screen-mouse-image=pointer.png :sout="#transcode{vcodec=h264,vb=1200,fps=10,scale=1,acodec=none,vfilter=croppadd{cropright=896,croptop=0,cropbottom=624,cropleft=0}}:file{mux=mp4,dst=outnew.mp4}"
@chssweb
chssweb / mindgenius regex.md
Last active August 29, 2015 14:02
Regex test to try and get url out of description
    <Node id="{CDA3925C-FAC0-43BC-8ED4-C69680EBF094}" Display="What's New in Version 4 Video(Double click the icon) http://www.ned.cc.uk" Order="0" FontFamily="Calibri" FontSize="14" FontBold="false" FontItalic="false" FontStrikeOut="false" BorderStyle="Solid" BorderWidth="2" FontColor="FF000000" Marker="00FFFFFF" HLinkText=""/>

##Search Pattern

    ^(.*)((http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?)(.*)(/>)$

##Replace Pattern

$1 $3 href="$2" />

@chssweb
chssweb / sequence.md
Last active August 29, 2015 14:02
Install composer, and then drush

Composer and Drush install on Host

Composer

  1. cd ~
  2. pwd - make sure you are at the right place you expect to be
  3. Make sure you have a bin directory (chost appears to have this by default)
  4. curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
  5. sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
@chssweb
chssweb / wp-tinymcev4.php
Created April 18, 2014 13:12
Modify menus in WP 3.9's new tinymce v4 editor
<?php
function my_theme_add_editor_styles() {
add_editor_style( CHILD_TEMPLATE_DIRECTORY . '/tinymce-style.css');
}
add_action( 'init', 'my_theme_add_editor_styles' );
// Callback function to insert 'styleselect' into the $buttons array
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
@chssweb
chssweb / bcn-experiments.php
Created February 10, 2014 16:40
Some experiements with Breadcrumb NavXT actions and hooks
<?php
/* Move Keyword trail to research level */
//add_action('bcn_after_fill','fix_keyword_breadcrumb');
function fix_keyword_breadcrumb($trail) {
if (is_tax( 'cp_keywords')){
// print_r($trail->breadcrumbs->title);
// unset($trail->trail[1]);
// $trail->trail = array_values($trail->trail);
return $trail;
}
<?php
class EO_Shortcode_Grouped_Lists extends EventOrganiser_Shortcodes {
static function init() {
add_shortcode('eo_group_events_by_date', array(__CLASS__, 'handle_eventlist_shortcode'));
}
// Modified copy of orginal handle_eventlist_shortcode
static function handle_eventlist_shortcode($atts = array(), $content = null) {