Skip to content

Instantly share code, notes, and snippets.

@7fe
7fe / gist:1114201
Created July 29, 2011 16:45
delimit.htm
<!doctype html>
<script>(function(undefined){
var recentDelimiter,
nativeIndexOf = Array.prototype.indexOf,
hasOwn = Object.prototype.hasOwnProperty,
toString = Object.prototype.toString,
isPrototypeOf = Object.prototype.isPrototypeOf,
prototypeProperty = 'isPrototypeOf',
@7fe
7fe / when.js
Created July 30, 2011 08:00
when then JavaScript
var when = function(funcs){
if(!(this instanceof when)){
return new when(arguments);
}
this.funcs = Array.prototype.slice.call(funcs);
}
when.prototype = {
then: function(then){
var i = 0,
funcs = this.funcs,
@7fe
7fe / when.js
Created July 30, 2011 08:03
when then JavaScript
var when = function(funcs){
if(!(this instanceof when)){
return new when(arguments);
}
this.funcs = Array.prototype.slice.call(funcs);
}
when.prototype.then = function(then){
var i = 0,
funcs = this.funcs,
l = funcs.length,
@7fe
7fe / Async_After.js
Created July 30, 2011 15:44 — forked from Raynos/Async_After.js
Flow control utility for node.js
var after = function _after(count, f) {
var c = 0, results = [];
return function _callback() {
results.push( arguments.length > 1 ? arguments : arguments[0] );
if (++c === count) {
f.apply(this, results);
}
};
};
@7fe
7fe / whenthen.js
Created July 31, 2011 04:13 — forked from geuis/whenthen.js
When-Then (pseudo javascript Promise)
var when = function(){
if( !(this instanceof when) ) return new when(arguments); //return new instance of itself
var self = this; //cached so the syntax of code within the function is more readable
self.pending = Array.prototype.slice.call(arguments[0]); //convert arguments passed in to array
self.pending_length = self.pending.length; //cache length of the arguments array
self.results = []; //container for results of async functions
(function(){ // define pass() within this context so that the outer scope of self(this) is available when pass() is executed within the user's async functions
@7fe
7fe / gist:1248911
Created September 28, 2011 19:11
CoffeeScript isn't simpler

Although the following examples could use parenthesis, the issue demonstrates how a trivially overlooked ending delimiter further complicated the language. Not only is the intent of the CoffeScript code unclear in these examples but the slight variation in the CoffeScript, produces radically different output. The CoffeeScript differences are so small it would be easy for someone to add accidentally while editing. Anonymous function passing and function calling in Javascript require no additional wrappers or edits, while in CoffeeScript you must add special case clarity for something commonplace in Javascript.

foo ->
  bar 'foo'
, -> 'bar'
@7fe
7fe / gist:1343756
Created November 6, 2011 23:11
CofeeScript can be worse

CofeeScript does have fewer characters, but it seems even the core functionality of the language is often overlooked.

Not only are the more special syntax values(like true, yes, on, false, no, off), but something simple in Javascript is really ambiguous in CofeeScript.

For example, take a look at the following examples, only white space changes throughout the examples, but look at the compiled code ;)

foo ->
  bar 'foo'
, -&gt; 'bar'
@7fe
7fe / gist:1378022
Created November 18, 2011 22:53
Make fail
make -C out BUILDTYPE=Release
make[1]: Entering directory `/home/austin/node/out'
CC(target) /home/austin/node/out/Release/obj.target/http_parser/deps/http_parser/http_parser.o
AR(target) /home/austin/node/out/Release/obj.target/deps/http_parser/libhttp_parser.a
CC(target) /home/austin/node/out/Release/obj.target/uv/deps/uv/src/uv-common.o
CC(target) /home/austin/node/out/Release/obj.target/uv/deps/uv/src/ares/ares_cancel.o
CC(target) /home/austin/node/out/Release/obj.target/uv/deps/uv/src/ares/ares__close_sockets.o
CC(target) /home/austin/node/out/Release/obj.target/uv/deps/uv/src/ares/ares_data.o
CC(target) /home/austin/node/out/Release/obj.target/uv/deps/uv/src/ares/ares_destroy.o
CC(target) /home/austin/node/out/Release/obj.target/uv/deps/uv/src/ares/ares_expand_name.o
package de.halirutan.mathematica.parsing.psi.util;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiWhiteSpace;
import com.intellij.psi.tree.IElementType;
import de.halirutan.mathematica.parsing.MathematicaElementTypes;
import de.halirutan.mathematica.parsing.psi.MathematicaVisitor;
import de.halirutan.mathematica.parsing.psi.api.*;
import de.halirutan.mathematica.parsing.psi.api.Number;
@Override protected void onResume(){
super.onResume();
AlertDialog.Builder builder1 = new AlertDialog.Builder(getApplicationContext());
builder1.setMessage("Write your message here.");
builder1.setCancelable(true);
builder1.setPositiveButton(
"Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {