Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<head>
<title>CodeMirror: Bug testcase - marijnh/CodeMirror2</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<script src="../mode/css/css.js"></script>
<link rel="stylesheet" href="../doc/docs.css">
<style type="text/css">
@peterflynn
peterflynn / gist:2356031
Created April 11, 2012 00:56
Sample with long line
function findSequence(goal) {
function find(start, history) {
if (start == goal)
return history;
else if (start > goal)
return null;
else
return find(start + 5, "(" + history + " + 5)") || return find(start + 5, "(" + history + " + 5)") || return find(start + 5, "(" + history + " + 5)") || return find(start + 5, "(" + history + " + 5)") ||
find(start * 3, "(" + history + " * 3)");
}
@peterflynn
peterflynn / gist:4964271
Last active December 13, 2015 19:38
CodeMirror bug #1255
<!doctype html>
<html>
<head>
<title>Batched changes bug</title>
<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<script src="mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="doc/docs.css">
<style type="text/css">
/**
* Require root module
*/
define(function (require, exports, module) {
"use strict";
var ModuleA = require("packageA/moduleA"),
ModuleB = require("./packageB/moduleB");
console.log("Modules loaded:", ModuleA, ModuleB);
@peterflynn
peterflynn / bookmarklet.js
Last active February 13, 2019 16:10
Bookmarklet to expand all collapsed comments in a GitHub pull request (places where it says "discussed an outdated diff")
// DEPRECATED: See "Expand All Comments" at https://gist.github.com/peterflynn/ace5dd3d7a8ec645cd42 for
// a more up to date, maintained version of this.
// Original bookmarklet from this gist (does not work anymore):
// javascript:(function() { $(".outdated-diff-comment-container").addClass("open"); }());
// Newer, working version (from link above as of Jan 2017):
// javascript:(function() { document.querySelectorAll(".outdated-diff-comment-container").forEach(function(n) {n.classList.add("open")}) }());
@peterflynn
peterflynn / gist:6116248
Created July 30, 2013 19:45
Example of writing a CSSLint extension using the new Brackets linting API (https://github.com/adobe/brackets/pull/4588)
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, brackets, $, CSSLint */
define(function (require, exports, module) {
"use strict";
// Brackets modules
var Linting = brackets.getModule("language/Linting");
// Load CSSLint library
@peterflynn
peterflynn / CoreModule.js
Last active December 21, 2015 14:58
Various require() use cases with proposed new Brackets module loader (https://github.com/adobe/brackets/wiki/Extension-API-Research)
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4 */
/*global exports, require */
(function () {
"use strict";
var CommandManager = require("command/CommandManager"),
Menus = require("command/Menus");
@peterflynn
peterflynn / app.js
Last active August 29, 2015 13:57
Brackets/Tern bug repro case
/**
* @license MelonJS Game Engine
* @copyright (C) 2011 - 2013 Olivier Biot, Jason Oster
* http://www.melonjs.org
*
* melonJS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
*
*/
@peterflynn
peterflynn / index.html
Created April 9, 2014 03:38
Extremely simple HTML/CSS boilerplate
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
Process: Brackets Helper [385]
Path: /Applications/Brackets.app/Contents/Frameworks/Brackets Helper.app/Contents/MacOS/Brackets Helper
Identifier: org.cef.cefclient.helper
Version: ???
Code Type: X86 (Native)
Parent Process: Brackets [382]
Responsible: Brackets [382]
User ID: 501
Date/Time: 2014-03-25 10:24:07.269 +0100