This file contains 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
#Git status completion add to your bash profile# | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ ' |
This file contains 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
// Base inspection function for prefilters and transports | |
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { | |
var inspected = {}, | |
seekingTransport = ( structure === transports ); | |
function inspect( dataType ) { | |
var selected; | |
inspected[ dataType ] = true; | |
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { |
This file contains 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
// Wrap the whole thing in domready and an anonymous function. | |
// This prevents anything inside of it from being clobbered | |
// in the global namespace and from clobbering anything | |
// in the global namespace. | |
// This is instead of defining the function globally and passing | |
// it to domready, like you did before:' | |
// $(function(){showLocation()}); | |
$(function(){ | |
// Take advantage of the fact that variables declared outside | |
// of a function are available inside any function declared |
This file contains 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
(add-to-list 'ac-modes 'coffee-mode) | |
(add-to-list 'ac-modes 'js-mode) | |
(add-to-list 'ac-modes 'handlebars-mode) |
This file contains 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
;; Copyright (C) 2013 Jack Viers | |
;; Author: Jack Viers <jackcviers@gmail.com> | |
;; This file is not part of GNU Emacs. | |
(defun kill-line-yank-newline () | |
(interactive) | |
(let ((beg (line-beginning-position)) (end (line-end-position)) (name (buffer-name)) (col (current-column))) | |
(end-of-line) | |
(newline) |
This file contains 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
new_row.append $('<td>').text(media.name), | |
$('<td>').text media.creator | |
$('<td>').text media.media_type |
This file contains 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
$("document").openPopup | |
url: 'test' | |
doOnContentLoad: -> console.log 'doOnContentLoad' |
This file contains 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
In "Make No Promises" David Nolen asserts that promises don't eliminate callback hell[1]. This is not true. Take a situation where a program makes several asynchronous calls and aggregates the results in some processing step. Each call may fail. If any one of the calls fails the program cannot continue processing and must report the error. | |
It would be possible to write the program in a traditional callback style, and make the code easy to understand and follow. I can think of two ways to do this. | |
The first is to make each call and define a success handler that added the results to a shared array, and an error handler that reported each error. Then pass the success and error handler to each call. This leads to a possible outcome where the resulting aggregation may be partially complete. The program must keep track of how many of the requests have completed. The program must check the length of the results on each completion and error to see if processing can continue. I dislike this approach, because the re |
This file contains 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
82c82 | |
< CONFIG["LIBRUBY_DLDFLAGS"] = "-undefineddynamic_lookup -multiply_definedsuppress -install_name $(libdir)/$(LIBRUBY_SO) -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(ruby_version) $(XLDFLAGS)" | |
--- | |
> CONFIG["LIBRUBY_DLDFLAGS"] = "-undefineddynamic_lookup -multiply_defined suppress -install_name $(libdir)/$(LIBRUBY_SO) -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(ruby_version) $(XLDFLAGS)" | |
125c125 | |
< CONFIG["DLDFLAGS"] = "-undefineddynamic_lookup -multiply_definedsuppress" | |
--- | |
> CONFIG["DLDFLAGS"] = "-undefineddynamic_lookup -multiply_defined suppress" |
OlderNewer