Skip to content

Instantly share code, notes, and snippets.

View eunomie's full-sized avatar

Yves Brissaud eunomie

View GitHub Profile
/**
* The default implementation of the import function. Writes a script tag to
* import the script.
*
* @param {string} src The script source.
* @return {boolean} True if the script was imported, false otherwise.
* @private
*/
goog.writeScriptTag_ = function(src) {
if (goog.inHtmlDocument_()) {
@eunomie
eunomie / m.js
Last active December 16, 2015 05:58
Markdown
h = document.getElementsByTagName('head')[0]
m = document.createElement('script'); m.src="https://pagedown.googlecode.com/hg/Markdown.Converter.js";h.appendChild(m)
document.body.innerHTML = '<table><tr><td contenteditable></td><td></td>'
a = document.createElement('style'); a.appendChild(document.createTextNode('table {width:100%;height:100%}td{width:50%;overflow:auto}td+td{background:#eeeeec}'));h.appendChild(a)
tds=document.getElementsByTagName('td')
s = tds[0]
p = tds[1]
;(_ = function() {
if (!("Markdown" in window)) {
window.setTimeout(_, 100)
@eunomie
eunomie / gist:4771409
Last active December 12, 2015 12:19
Mac setup from scratch (just a list of softwares to install)
@eunomie
eunomie / G.js
Created April 17, 2012 14:38
inconsistent code style
/**
* @param {*} input to create the G with.
* @param {string|Element|Node=} opt_mod elemnt to look under.
* @constructor
* @return {G} the G object.
*/
G = function(input, opt_mod) {
if (input.constructor == G) // if with one statement and no {}
return /** @type {G} */(input);
if (goog.isString(opt_mod)) { // if with one statement but {}