Skip to content

Instantly share code, notes, and snippets.

View mattneary's full-sized avatar

Matt Neary mattneary

View GitHub Profile
@mattneary
mattneary / index.html
Created January 1, 2012 06:35
api edited gist
<html>
<head>
<title></title>
</head>
<body>
<style>
body {
background: red
}
</style>
@mattneary
mattneary / index.html
Created January 1, 2012 07:41
Site Prototype
<html>
<head>
<title></title>
</head>
<body>
<style>
body {
background: red;
}
</style>
@mattneary
mattneary / index.html
Created January 1, 2012 07:42
Construct App 2
text
@mattneary
mattneary / index.html
Created January 1, 2012 07:44
Site Prototype
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@mattneary
mattneary / index.html
Created January 1, 2012 07:45
Show Mom
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@mattneary
mattneary / index.html
Created January 1, 2012 07:57
Show Mom
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@mattneary
mattneary / index.html
Created January 1, 2012 08:56
New App
text
@mattneary
mattneary / index.js
Created January 4, 2012 23:54
Native Operators recreated
function range(start,end) {
return Array(end-start+1).join(0).split(0).map( function(v,i) {
return i+start;
});
}
function if_condition(bool,body,else_call) {
return bool()&&body() || else_call();
}
@mattneary
mattneary / index.js
Created March 8, 2012 00:54
Esoteric language with 2 vars and only recursive function calls
var parseLambda = function(string) {
var replacements = [
[/\^/g, "++x;"],
[/_/g, "--x;"],
[/\~/g, "++v;"],
[/\./g, "--v;"],
[/\$/g, "x"],
[/\#/g, "v"],
[/@/g, "return "],
[/!\(([^)]+)\)/g, "arguments.callee($1)"],
@mattneary
mattneary / index.js
Created June 23, 2012 20:26
Visible in Parent
(function($, window) {
$.belowthefold = function(element, settings) {
var fold = $(window).height() + $(window).offset().top;
return fold <= $(element).offset().top - settings.threshold;
};
$.abovethetop = function(element, settings) {
var top = $(window).offset().top;
return top >= $(element).offset().top + $(element).height() - settings.threshold;