Skip to content

Instantly share code, notes, and snippets.

View dieseltravis's full-sized avatar
🆗
I'm ok

Travis Hardiman dieseltravis

🆗
I'm ok
View GitHub Profile
@rbj325
rbj325 / gist:e6b28a04bc43eccb5b62
Last active August 29, 2015 14:02
vNext Ubuntu Server Setup
Installation
http://graemechristie.github.io/graemechristie/blog/2014/05/26/asp-dot-net-vnext-on-osx-and-linux/
http://www.mono-project.com/Compiling_Mono_From_Git
Ubuntu:
apt-get update
apt-get dist-upgrade
apt-get install build-essential git autoconf libtool g++ gettext automake unzip
git clone git://github.com/mono/mono.git
@dieseltravis
dieseltravis / cached-xml.cs
Last active August 29, 2015 17:34
Caching an XML document with a file dependency
XmlDocument xDoc = null;
string xmlPath = "~/App_Data/SomeXml.xml";
if (HttpContext.Current.Cache[xmlPath] == null) {
string cacheFilePath = HttpContext.Current.Server.MapPath(xmlPath);
xDoc = new XmlDocument();
xDoc.Load(cacheFilePath);
HttpContext.Current.Cache.Insert(xmlPath, xDoc, new CacheDependency(cacheFilePath));
} else {
xDoc = (XmlDocument)HttpContext.Current.Cache[xmlPath];
@cowboy
cowboy / jquery.ba-isversion.js
Created July 1, 2010 17:36
Test jQuery version WIP UNTESTED
/*!
* jQuery isVersion - v0.1 - 07/02/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
using System;
using System.Linq;
using Newtonsoft.Json.Linq;
namespace FacebookChallenge
{
class Program
{
static readonly string accessToken = "GET YOUR OWN FOO";
static readonly string baseUrl = "https://graph.facebook.com/{0}/{1}?access_token={2}";
//dynamically generated by ASP.NET for the language passed in.
var labels = {
language: 'English',
objectOverlay: {
closeX: 'Close X',
fallback: 'Video for {vid}'
},
global: {
label1: 'label1',
label2: 'label2'
@jsjohnst
jsjohnst / comment_flag_in.css
Created December 27, 2010 05:45
Pure CSS (without extra HTML markup) comment speech bubbles for SquareSpace blogs.
.journal-comment-area-wrapper .comment .signature:before {
font-size: 10px;
content: '';
display: block;
height: 0;
width: 0;
border-right: 2em solid #666;
border-bottom: 2em solid #000;
border-bottom: 2em solid transparent;
position: absolute;
@remy
remy / gist:804414
Created January 31, 2011 17:24
Simple CSS parser
function parseCSS(str) {
function trim(str) {
return (str||'').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
var i, j, k,
split = '}',
cur_key = '',
cur_key_split,
css = str.replace(/\t*/g, '').replace(/\s{2}/, ' ').replace(/[\n|\r]/g, ' ').replace(/\/\*.*?\*\//g, '').split(split),
@nathos
nathos / twitterbutton.sass
Last active September 26, 2015 18:17
Scalable twitter button
.twitterbutton
// change size to any (reasonable) percentage/px you want
// font-size: 200%
color: #4e839e
font-family: "Helvetica Neue", Arial, sans-serif
font-weight: 300
line-height: 1em
text-decoration: none !important
text-rendering: optimizeLegibility
padding: 0.5em 0.7em
@samuelcole
samuelcole / jquery.preload_background_image.js
Created March 23, 2012 21:06
A little plugin for preloading background images (for spinners 'n stuff).
(function ($) {
function background_image_url($object) {
var string = $object.css('backgroundImage'),
url_regex = /[("]([^()"]+)[")]/;
return url_regex.exec(string)[1];
}
$.fn.preload_background_image = function () {
return $(this).each(function () {
(new Image()).src = background_image_url($(this));
@bennadel
bennadel / trigger.htm
Created April 26, 2012 14:32
Mouse vs. Keyboard - Determining Click Initiator Using A jQuery Custom Event
<!DOCTYPE html>
<html>
<head>
<title>Determine Link Trigger Method With jQuery</title>
</head>
<body>
<h1>
Determine Link Trigger Method With jQuery
</h1>