This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint browser:true*/ | |
// ==UserScript== | |
// @name Bitbucket PR branches | |
// @namespace http://curtisharvey.com/ | |
// @version 0.1 | |
// @description Ugly hack to add "Source" and "Target" columns to Bitbucket Pull Requests list | |
// @author Curtis Harvey | |
// @match https://bitbucket.org/*/pull-requests/ | |
// @match https://bitbucket.org/*/pull-requests/?displaystatus=open | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Parse various time formats into standard H:i:s format (e.g. "2:30pm" -> "14:30:00"). | |
* | |
* @param string $timeString Time to parse | |
* @param boolean $includeSeconds Optionally include seconds, default = true | |
* | |
* @return string|null Null if unable to parse time | |
*/ | |
function parseTime($timeString, $includeSeconds = true) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_versions () | |
{ | |
local ver_re='v[0-9]+\.[0-9]+\.[0-9]+'; | |
local active="$(node --version 2> /dev/null)"; | |
local installed=($(nvm ls | grep -vE ':|->' | grep -oE "$ver_re" | sort -u)); | |
local aliased=($(nvm alias | sed 's/ -> /:/')); | |
local latest="$(curl -s http://nodejs.org/dist/latest/ -o - | grep -oE "$ver_re" | sort -u)"; | |
local output=""; | |
curl -s http://nodejs.org/dist/ -o - | grep -oE "$ver_re" | sort -uV | while read v; do | |
output="$v"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# commit modified files using lines removed from TODO.md as commit message | |
git ci -am "$(git diff "TODO.md" | awk '/^-\* / {printf substr($0, 4)"; "}')" | |
# make it easier by adding an alias to .gitconfig | |
[alias] | |
todone = "!git ci -am \"$(git diff \"TODO.md\" | awk '/^-\* / printf substr($0, 4)\"; \"}')" | |
# make it smarter by looking for the TODO.md file or accepting it as an argument | |
[alias] | |
todone = "!f () {\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $(id -u) != 0 ]]; then | |
echo "Script requires root priviliges" | |
echo "Run with: sudo $(basename $0)" | |
exit 1 | |
fi | |
ask () { | |
echo -ne "===> $@ [y/n] " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/editor/js/selection.js b/src/editor/js/selection.js | |
index a046f0a..448cbf8 100644 | |
--- a/src/editor/js/selection.js | |
+++ b/src/editor/js/selection.js | |
@@ -143,34 +143,20 @@ | |
* @method filterBlocks | |
*/ | |
Y.Selection.filterBlocks = function() { | |
- var childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true, | |
- sel, single, br, divs, spans, c, s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Light-weight YUI-dependend Script Loader | |
* - loads YUI 3 if not already loaded | |
* - then loads your script(s) | |
* | |
* Useful for dynamically loaded modules, injected scripts, bookmarklets, etc… | |
*/ | |
(function() { | |
// YUI to load if unavailable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/node | |
var sys = require('sys'), | |
iter = [], | |
start = (process.argv.length > 2) ? parseInt(process.argv[2], 10) : null, | |
stdin; | |
function askForNumber() { | |
sys.print('enter a number: '); | |
if (stdin) { |