Skip to content

Instantly share code, notes, and snippets.

@m-gagne
m-gagne / gist:1706076
Created January 30, 2012 19:15
Method that returns a boolean indicating if the widget has been destroyed. Useful when your widget relies on async operations and where it could have been destroyed before the callback was run.
_isDestroyed: function() {
var widget = this.element.data( this.widgetName );
return (typeof widget) === 'undefined' || widget === null;
}
<!-- RareLogic Analytics Script v1.0 //-->
<script type="text/javascript">
document.write(unescape("%3Cscript src='"+
(("https:" == document.location.protocol) ? "https://" : "http://")+
"d.rare.io/rl.js' type='text/javascript'%3E%3C/script%3E"
));
</script>
<!-- RareLogic Analytics Script End //-->
@m-gagne
m-gagne / sample.rb
Created February 2, 2012 20:25
RareLogic Query API - Pages Report Sample
require 'oauth'
# A simple Pages pivoted by Category report for the current week
query_json = <<EOS
{
"report": {
"report_type": "standard",
"pivots_attributes": [
{
"family": "content",
@m-gagne
m-gagne / gist:2007137
Created March 9, 2012 15:43
Improper use of YouTube iFrame API
player = new YT.Player( 'introVideo', {
height: '270',
width: '480',
videoId: 'YyCMNdpF6uQ',
playerVars: {
rel: 0,
showinfo: 0
}
});
@m-gagne
m-gagne / windowspager.ini
Created April 14, 2012 16:38
My Ubuntu(ish) settings for WindowsPager
;;WindowsPager.ini file.
;;(c) 2009, 2010, 2011 Jochen Baier, email@jochen-baier.de
;;number of rows and columns of virtual desktops
;;default is rows=1, columns=4 (=4 virtual desktops in one row)
[Layout]
rows=1
columns=4
@m-gagne
m-gagne / Preferences.sublime-settings
Created April 16, 2012 16:01
Sublime 2 User Preferences
{
"color_scheme": "Packages/Color Scheme - Default/SpaceCadet.tmTheme",
"detect_indentation": false,
"font_face": "Bitstream Vera Sans Mono",
"font_size": 10,
"hot_exit": false,
"remember_open_files": false,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
@m-gagne
m-gagne / Preferences.sublime-settings
Created April 16, 2012 19:44
Sublime 2 User Preferences
{
"color_scheme": "Packages/Color Scheme - Default/SpaceCadet.tmTheme",
"detect_indentation": false,
"font_face": "Bitstream Vera Sans Mono",
"font_size": 10,
"hot_exit": false,
"remember_open_files": false,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
@m-gagne
m-gagne / sub.cmd
Created May 9, 2012 21:19
Command for opening sublime and adding the current directory to the project
@echo off
"c:\Program Files\Sublime Text 2\sublime_text.exe" -n -a .
@m-gagne
m-gagne / test.js
Created October 5, 2012 18:15
my sample js code
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
};
@m-gagne
m-gagne / pinned_site_windows_8.html
Created October 26, 2012 13:50
Format a pinned site tile in Windows 8
<meta name="application-name" content="Woot Studio"/>
<meta name="msapplication-TileColor" content="#FCFDFF"/>
<meta name="msapplication-TileImage" content="tile_icon_144x144.png"/>