This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!document.querySelectorAll) { | |
| document.querySelectorAll = function(selector) { | |
| var doc = document, | |
| head = doc.documentElement.firstChild, | |
| styleTag = doc.createElement('STYLE'); | |
| head.appendChild(styleTag); | |
| doc.__qsaels = []; | |
| styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}"; | |
| window.scrollBy(0, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PLUGINDIR="$HOME/Library/Application Support/Plex Media Server/Plug-ins" | |
| BUNDLEDIR="$PLUGINDIR/LetMeWatchThis.bundle" | |
| if [ -d "$BUNDLEDIR" ]; then | |
| rm -rf "$BUNDLEDIR" | |
| fi | |
| mkdir "$BUNDLEDIR" | |
| curl -Ls https://github.com/ReallyFuzzy/LetMeWatchThis.bundle/tarball/master 2>&1 | tar xz - --strip-components=1 -C "$BUNDLEDIR/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dig @primary-nameserver.example.com example.com axfr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Request object for handling alternative HTTP requests | |
| * | |
| * Alternative HTTP requests can come from wireless units like mobile phones, palmtop computers, | |
| * and the like. These units have no use for Ajax requests, and this Component can tell how Cake | |
| * should respond to the different needs of a handheld computer and a desktop machine. | |
| * | |
| * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
| * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install:¶ | |
| @find . -iname '*.symlink' | sed -e "p;s!\./\(.*\).symlink!$(HOME)/\1!" | xargs -n2 ln -s -i | |
| #recurses through files with .symlink on the end and creates a symlink in ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // includes bindings for fetching/fetched | |
| PaginatedCollection = Backbone.Collection.extend({ | |
| fetch: function(options) { | |
| options || (options = {}); | |
| var self = this, | |
| success = options.success; | |
| options.success = function(resp) { | |
| self.trigger("fetched"); | |
| if(success) { success(self, resp); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x = {key:['x','y','z'],val:123}, | |
| c = x.key.length, | |
| b = false, | |
| memo = {}; | |
| for(var y=0;y<c;y++) { | |
| if (!b && !memo[x.key[y]]) { | |
| memo[x.key[y]] = y<c-1 ? {} : x.val; | |
| b = memo[x.key[y]]; | |
| } else if (!b[x.key[y]]) { | |
| b[x.key[y]] = y<c-1 ? {} : x.val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Modernizr.addTest('css3mediaquery',function(a,b){var a=document,b='screen and (min-width: 1px)',c={},d=a.documentElement,e=a.createElement("body"),f=a.createElement("div");f.setAttribute("id","ejs-qtest"),e.appendChild(f);return function(g){if(c[g]===b){var h=a.createElement("style");h.type="text/css";var i="@media "+g+" { #ejs-qtest { position: absolute; width: 10px; } }";h.styleSheet?h.styleSheet.cssText=i:h.appendChild(a.createTextNode(i)),d.insertBefore(e,d.firstChild),d.insertBefore(h,d.firstChild),c[g]=f.offsetWidth==10,d.removeChild(e),d.removeChild(h)}return c[g]}}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT Note.created ucreated, Note.id FROM customers Customer JOIN services Service JOIN notes Note ON (Service.customer_id=Customer.id AND Note.service_id=Service.id) WHERE (Note.user_id=1 OR Service.user_id=1) | |
| # I really want to expand this to include notes left by anyone for a customer that has a service belonging to you (yet the note is customer specific not service specific via a HasMany relationship) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!empty($settings['ignore'])) { | |
| $words = array(); | |
| foreach((array) $settings['ignore'] as $word) { | |
| $words[] = preg_quote($word); | |
| } | |
| $newString = preg_replace('/\b(\s*)(' . implode('|', $words) . ')(\s*)\b/i', '\\1\\3', $string); | |
| if (!empty($newString)) { | |
| $string = $newString; | |
| } | |
| } |