Skip to content

Instantly share code, notes, and snippets.

View djbobbydrake's full-sized avatar

Chhay Chhun djbobbydrake

View GitHub Profile
@djbobbydrake
djbobbydrake / firefox
Created September 6, 2013 16:16
Firefox shell script
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
@djbobbydrake
djbobbydrake / sass-extendable
Created May 8, 2014 17:41
sass extendables
%tweet-media-next-prev {
position: absolute;
top: 40%;
width: 53px;
height: 104px;
cursor: pointer;
overflow: auto;
background: rgba(0, 120, 148, .4);
z-index: 100;
@djbobbydrake
djbobbydrake / Drupal-js
Created May 14, 2014 19:32
JS in Drupal
(function($) {
Drupal.behaviors.mobileFormErrors = function (context) {
$("form.user-form", context).each(function(){
if ($(this).find(".error").length) {
window.location.hash = window.location.hash || $(this).attr("id");
return false;
}
});
};
@djbobbydrake
djbobbydrake / WMBA-mba-twitter-adjustments
Created May 19, 2014 17:13
WMBA-mba-twitter-adjustments
.mba-twitter-trends {
padding-top: 10px;
.block & {
padding-top: 0;
}
}
.mba-twitter-trends-box {
width: 50%;
float: left;
@djbobbydrake
djbobbydrake / gist:d83219a34d0093f88cd4
Created May 28, 2014 23:28
media query nestled within selector
.ec-cookie-message {
#teconsent {
float: right;
padding-right: 5px;
img {
display: block;
}
}
a {
text-decoration: underline;
@djbobbydrake
djbobbydrake / mobile detect regex
Created October 9, 2014 16:20
mobile detect regex
\biPhone.*Mobile|\biPod|BlackBerry|\bBB10\b|rim[0-9]+|HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m|Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b|Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711
@djbobbydrake
djbobbydrake / speare-json
Last active August 29, 2015 14:09
Testing Speare - json
{"title":"What the narwhal's tusk is really for","content":"<p>EVER since Europeans began trading the whorled ivory tusk of the narwhal in the 12th century,&nbsp;people have puzzled over its purpose. Early research was hampered by the widespread myth that the tusk came from the head of a unicorn. Its supposed magic properties made it a prized item:&nbsp;Queen Elizabeth I bought one for &#163;10,000, the price of a castle. Yet even after it was firmly established that the tusk was the left-front tooth of the narwhal, an Arctic whale unappealingly named the \"corpse whale\" by Scandinavians because of its mottled colouring (<em>nar<\/em> means corpse and <em>hvalr<\/em> means whale in Old Norse), conjecture continued as to why a whale would have developed such an appendage. What is its purpose?<\/p><p>Herman Melville, the author of \"Moby Dick\", joked that the tusk, which can grow close to three metres in length, was a letter opener. Charles Darwin thought it had something to do with sexual selection, because
<!-- simple-todos.html -->
<head>
<title>Todo List The Real Deal</title>
</head>
<body>
<div class="container">
<header>
<h1>Todo List</h1>
<!-- add a form below the h1 -->
@djbobbydrake
djbobbydrake / gist:0587ec0c8de8b2e618b5
Created February 2, 2015 19:25
vagrant vm salt failures
local:
----------
ID: epel
Function: pkgrepo.managed
Result: True
Comment: Package repo 'epel' already configured
Started: 14:04:16.994102
Duration: 13.078 ms
Changes:
----------
@djbobbydrake
djbobbydrake / php-notices.md
Last active August 29, 2015 14:20
PHP notices

Hi everyone,

Yesterday, I merged in a branch to re-enable PHP notices in our development environments and to fix quite a few of them (I've updated more than 80 files in the process). I committed a few follow-up branches to fix broken tests. As it currently stands, I believe I've fixed all of the selenium tests, but I can't tell, because the test runner is currently blocked by a few jobs on bigmac. I also can't tell if simpletest is red or green, because I can't access Hudson (it's after hours, so couldn't get Mike to whitelist my IP). I may be blocking you from merging tomorrow, but please don't merge until the tests are resolved. I believe the effort will be worth the benefits. PHP notices have been disabled for quite a long time in our dev environments. I believe that re-enabling PHP notices should lead to much better quality code and result in fewer bugs. As part of our development process, we should keep an eye on two log files where the PHP notices will appear.

  1. /var/log/drupal.log
  2. /var/lo