View _debug.scss
/* ----------------------------------------------------------------------------
* DEBUG CSS for XDEBUG
* ------------------------------------------------------------------------- */
pre.xdebug-var-dump {
display: table;
width: 100%;
padding: 5rem;
margin: 5rem;
font: 2.5rem/2.5 'Operator Mono';
}
View xdebug_sublime.md
  • Check phpinfo() if xdebug is on.
  • + + F9 to set a breakpoint.
  • + + F6 to step over.
  • + + P to set watch expression.
  • + fn + f8 set/remove a breakpoint.
  • + + fn + f9 start debugging.
  • + + fn + f6 step over. --ignore
  • + + fn + f7 step into. --check
  • + + fn + f8 step out. --get_back
View list_apps.sh
#!/bin/sh
(
for i in /Applications/*.app
do
Printf "$i \t" | cut -c15-1000
/usr/libexec/plistbuddy -c Print:CFBundleShortVersionString: "$i"/Contents/info.plist
done
for u in /Applications/Utilities/*.app
do
View wpcc.md
  • Clone the official Git repo inside a folder called WPC
  • There should be a gruntfile.js in the WPC's root
  • There should also be src and build folders
  • src is where you make changes, build is where grunt will build the changes you made!
  • With DesktopServer install a local WP inside the WPC folder and call it WPCore.dev
  • Move the wp-config.php file from WPCore.dev folder to the parent WPC folder
  • Open gruntfile.js and change the build to WPCore.dev i.e. BUILD_DIR = 'wpcore.dev/',
  • Now, via command line go to src folder and run the command 'svn up .' (without quotes with the space and period at the end) — this will update the trunk to the latest code
  • Make any changes in the src folder
  • Then cd to WPC folder and run grunt
View disable_mac_animations.sh
# Open the Terminal app and run any of the below commands.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
View post.php
<!-- Add this anywhere in the page. It assumes your content is inside an <article> tag. -->
<a class="floating-twitter-share-link" href="#" title="Share this" target="_blank">
<i class="fa fa-twitter floating-twitter-share"></i>
</a>
View swap.sh
#! /usr/bin/env bash
swapoff -a
dd if=/dev/zero of=/swapfile bs=1M count=1024
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# nano /etc/fstab
st /etc/fstab
View monitrc
# Monit with EasyEngine v3.7.4
####.#### ———————————————————————————————————————————— Monit Configuration ———————————————————————————————————————————— ####.####
set daemon 60 #check services every 60 seconds
set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state
####.#### ———————————————————————————————————————————— HTTP ———————————————————————————————————————————— ####.####
set httpd port 2812 address 0.0.0.0 # allow port 2812 connections on all network adapters
View webmin.sh
#! /usr/bin/env bash
apt-get install libauthen-pam-perl libio-pty-perl libnet-ssleay-perl libapt-pkg-perl apt-show-versions libwww-perl libauthen-sasl-perl -y
cd /tmp
wget http://www.webmin.com/download/deb/webmin-current.deb
dpkg -i webmin-current.deb
ufw allow 10000/tcp
View ptcl_reboot.sh
# Bash script to reboot the PTCL router
# Replace 'host_address', 'username', and 'password'
# Usage: (sleep 1;echo admin;sleep 1;echo dBe12;sleep 1;echo "reboot"; sleep 1;) | telnet 192.168.10.1
(sleep 1;echo "$username";sleep 1;echo "$password";sleep 1;echo "reboot"; sleep 1;) | telnet "$host_address"