Skip to content

Instantly share code, notes, and snippets.

View prettydiff's full-sized avatar
💭
Home from military deployment

Austin Cheney prettydiff

💭
Home from military deployment
View GitHub Profile
/*global document*/
//a function to get DOM nodes by nodeType property.
//If you do not supply a value I will give you every DOM node.
//
//example:
// var allComments = document.getNodesByType(8);
// or
// var allComments = document.getNodesByType("COMMENT_NODE");
//
//The accepted string values are the actual node type names, so that the
/*global define, brackets, console*/
define(function (require, exports, module) {
"use strict";
var CommandManager = brackets.getModule("command/CommandManager"),
Menus = brackets.getModule("command/Menus"),
EditorManager = brackets.getModule("editor/EditorManager"),
Editor = brackets.getModule("editor/Editor").Editor,
DocumentManager = brackets.getModule("document/DocumentManager"),
Document = brackets.getModule("document/Document"),
@prettydiff
prettydiff / gist:e55e22a96792f5185363
Created April 4, 2015 03:39
recursive setTimeout example
var asdf = function () {
if (typeof myTargetFunction === function) {
return awesome();
}
setTimeout(asdf, 100);
};
var core = function core(api) {
if (cmode === "beautify") {
if (capi === "" && cjsscope !== "none" && clang === "javascript") {
builder.head = "a";
builder.cssCore = "body{font-family:'Arial';font-size:10px;overflow-y:scroll;}#samples #dcolorScheme{position:relative;z-index:1000}#apireturn textarea{font-size:1.2em;height:50em;width:100%}button{border-radius:.9em;display:block;font-weight:bold;width:100%}div .button{text-align:center}div button{display:inline-block;font-weight:bold;margin:1em 0;padding:1em 2em}button:hover{cursor:pointer}#introduction{clear:both;margin:0 0 0 5.6em;position:relative;top:-2.75em}#introduction ul{clear:both;height:3em;margin:0 0 0 -5.5em;overflow:hidden;width:100em}#introduction li{clear:none;display:block;float:left;font-size:1.4em;margin:0 4.95em -1em 0}#introduction li li{font-size:1em;margin-left:2em}#introduction .information,#webtool #introduction h2{left:-90em;position:absolute;top:0;width:10em}#introduction h2
{% extends 'todo_lists/base.html' %}
{% block header_text %}Your to-do list{% endblock %}
{% block form_action %}/lists/{{ list.id }}/add_todo_item{% endblock %}
{% block table %}
<table id="id_todo_list_table">
{% for item in list.todoitem_set.all %}
{ # comment # }
{# comment #}
@prettydiff
prettydiff / gist:4f34ed2f343cda0a1de0
Created January 13, 2016 12:33
Atom Beautify Debug
# Atom Beautify - Debugging information
The following debugging information was generated by `Atom Beautify` on `Wed Jan 13 2016 06:30:08 GMT-0600 (CST)`.
---
**Platform**: darwin
## Versions
var expWebTest = (function () {
var test = function () {
/*var delay = function (testExpression, callback) {
if (testExpression === true) {
return setTimeout(function () {
console.log("test delay");
delay(node, callback);
}, 100);
}
console.clear();
/*global ace, define, global, module*/
/*jslint browser:true, for:true*/
(function language_init() {
"use strict";
var language = {};
language.setlangmode = function language_setlangmode(input) {
var langmap = {
coldfusion: "markup",
csharp: "javascript",
css: "css",
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pretty Diff - The Militant Programmer</title>
<link href="../css/index.css" media="all" rel="stylesheet" type="text/css"/>
<link href="timeline.css" media="all" rel="stylesheet" type="text/css"/>
<link
href="http://prettydiff.com/guide/unrelated_dom.xhtml"
rel="canonical"
<--- Last few GCs --->
6804 ms: Mark-sweep 1379.8 (1424.2) -> 1160.4 (1204.8) MB, 276.4 / 0 ms [allocation failure] [GC in old space requested].
7106 ms: Mark-sweep 1160.4 (1204.8) -> 1160.4 (1204.8) MB, 302.2 / 0 ms [allocation failure] [GC in old space requested].
7403 ms: Mark-sweep 1160.4 (1204.8) -> 1160.4 (1204.8) MB, 297.3 / 0 ms [last resort gc].
7690 ms: Mark-sweep 1160.4 (1204.8) -> 1160.4 (1204.8) MB, 286.5 / 0 ms [last resort gc].
<--- JS stacktrace --->