Skip to content

Instantly share code, notes, and snippets.

View acobster's full-sized avatar

Coby Tamayo acobster

View GitHub Profile
@acobster
acobster / ModuleTest.php
Last active November 11, 2015 16:39
Platform-specific PHPUnit/Selenium test case architecture
<?php
/* /test/module/ModuleTest.php */
class ModuleTest extends PlatformSpecificTestCase {
public function setUp() {
$this->login();
}
// test stuff
@acobster
acobster / wordpress-functions.bash
Last active November 5, 2015 01:32
Get to themes/plugins folders from anywhere within a WordPress Git repo
# detect the public html directory of your WP repo
wp-html-dir() {
root=$(git rev-parse --show-toplevel)
if [[ -d $root/html/wp ]] ; then
html=$root/html/wp
elif [[ -d $root/html ]] ; then
html=$root/html
elif [[ -d $root/wp ]] ; then
html=$root/wp
fi
@acobster
acobster / config
Last active November 4, 2015 03:27
Grab/push specific files between a remote directory and a local Git working directory, preserving directory structure
# .grab/config
GRAB_USER='user'
GRAB_HOST='hostname'
GRAB_REMOTE_ROOT='/var/www/html/some/path'
@acobster
acobster / head
Created March 7, 2015 00:12
Make all text un-selectable - CSS3 with Javascript fallback
<style>
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>