Skip to content

Instantly share code, notes, and snippets.

View acobster's full-sized avatar

Coby Tamayo acobster

View GitHub Profile
@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>
@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 / 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 / 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 / CustomMenu.php
Created February 18, 2016 17:44
Extending TimberMenu
<?php
/**
* Custom Menu class to add special nav behavior on top of
* TimberMenu instances.
*
* Context: https://github.com/jarednova/timber/issues/808
*/
class CustomMenu extends \TimberMenu {
public $MenuItemClass = '\CustomMenuItem';
@acobster
acobster / keybase.md
Last active October 23, 2017 19:49
keybase.md

Keybase proof

I hereby claim:

  • I am acobster on github.
  • I am acobster (https://keybase.io/acobster) on keybase.
  • I have a public key ASCoxDMqIGdEVRgPACqiDJecZRkRXeyRy1oDKkVW2Bcz7go

To claim this, I am signing this object:

@acobster
acobster / output
Created January 6, 2017 20:59
./cluster/kube-up.sh output
$ ./cluster/kube-up.sh
... Starting cluster using provider: vagrant
... calling verify-prereqs
... calling kube-up
Bringing machine 'master' up with 'virtualbox' provider...
Bringing machine 'node-1' up with 'virtualbox' provider...
==> master: Box 'kube-fedora23' could not be found. Attempting to find and install...
master: Box Provider: virtualbox
master: Box Version: >= 0
==> master: Box file was not detected as metadata. Adding it directly...
@acobster
acobster / .bashrc
Created January 18, 2017 17:18
Customize bash prompt based on current cwd/environment
# You want your prompt to warn you if you are in the directory tree of a production environment.
# Set the `LIVE_DIRS` array to the list of whatever directories should be considered production,
# and your prompt will contain a big, red "[PRODUCTION]" whenever you're in one of those directories,
# or a subdirectory thereof.
# Customize this variable
LIVE_DIRS=(/var/www/example.com /var/www/example2.com)
cwdEnvironment() {
local _live
@acobster
acobster / poc.ino
Created June 21, 2017 05:05
fclooper
#include <Bounce2.h>
const int channel = 9;
const int LED = 14;
const int POT = 15;
const int DEBOUNCE_INTERVAL = 55;
int level;
@acobster
acobster / instructions.md
Created January 30, 2018 21:11
Scenario 4 Instructions
  1. Retrieve TRANQ GUN and BLAST Rick & Morty
  2. Retrieve 2 vials (Blue & Yellow) + AMMONIA SALTS
  3. Place BLUE VIAL into HELMET and place on Rick
  4. Wait 60 seconds and then remove HELMET
  5. Reload with YELLOW VIAL and place on Morty
  6. Wait 60 seconds then remove HELMET
  7. Drag Rick & Morty to the TV COUCH
  8. Turn on INTERDIMENSIONAL CABLE
  9. Break the AMMONIA SALTS and wave under noses
  10. When Rick & Morty awake leave the room