Skip to content

Instantly share code, notes, and snippets.

View TexRx's full-sized avatar
🏠
Working from home

Bobbie Tables TexRx

🏠
Working from home
  • Austin, TX
View GitHub Profile
@TexRx
TexRx / example.html
Created October 4, 2012 06:56 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@TexRx
TexRx / gist:3838114
Created October 5, 2012 04:32 — forked from joelclermont/gist:3735026
using yepnope for twitter js and css with local fallback
function cssLoaded(href) {
var cssFound = false;
for (var i = 0; i < document.styleSheets.length; i++) {
sheet = document.styleSheets[i];
if (sheet['href'].indexOf(href) >= 0 && sheet['cssRules'].length > 0) {
cssFound = true;
}
};
@TexRx
TexRx / gist:3903714
Created October 17, 2012 04:31 — forked from getify/gist:3884928
sublime JSON coloring for Monokai theme
<dict>
<key>name</key>
<string>JSON String</string>
<key>scope</key>
<string>meta.structure.dictionary.json string.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#E6DB74</string>
</dict>

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
/**
* Shorten a string by a specified number of characters and end the string
* using either a user specified suffix or a default suffix.
* Ensures string is not abbreviated prematurely (e.g. half way through a word)
*
* @param {string} user specified string
* @param {number} the maximum allowed characters before abbreviating
* @param {string} the characters used to end the string
* @return {string} the abbreviated string
*/

Global .gitignore

We don't want to polute the repository with a .gitignore file... so you must add common OS files to your Global .gitignore. If you don't already have a global .gitignore then follow the instructions below (from: http://help.github.com/ignore-files/) or skip to the next section.

cd ~   
touch .gitignore_global   
mate .gitignore_global   
@TexRx
TexRx / $.js
Created March 15, 2013 16:46 — forked from remy/$.js
$ = function (document) {
var element = Element.prototype,
nodeList = NodeList.prototype;
element.on = function () {
element.addEventListener.apply(this, arguments);
return this;
};
nodeList.on = function (event, fn) {
@TexRx
TexRx / resize.js
Last active April 4, 2023 18:28 — forked from robtarr/resize.js
(function(w) {
var resizeTimer
, $win = $(w);
// Assuming we have jQuery present
$win.on( "resize", function() {
// Use resizeTimer to throttle the resize handler
clearTimeout( resizeTimer );
resizeTimer = setTimeout(function() {
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
using System;
using System.Linq.Expressions;
using System.Reflection;
using System.Xml.Linq;
namespace Nwazet.Commerce.Helpers {
public static class XmlHelper {
public static string Attr(this XElement el, string name) {
var attr = el.Attribute(name);