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
public interface StatelessThing { | |
public void doThing(Context ctx, Argument1 arg); | |
} | |
public class ContextAdapter { | |
private final Context ctx; | |
private final StatelessThing thing; | |
public ContextAdapter(Context ctx, StatelessThing thing) { | |
this.ctx = ctx; |
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
Y.namespace('Squarespace.Enums').RecordTypes = { | |
'TEXT': { | |
value: 1, | |
title: 'Text', | |
string: 'text' | |
} | |
}; |
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
/* Converts a string {a} to the following format: | |
* "eval(String.fromCharCode(a_1, a_2, .... , a_n))" | |
*where a_n is the Unicode value of the character at index 'n' in a. | |
*/ | |
var toPayload = function(code) { | |
var payload = Array.prototype.map.call(code, function(char) { | |
return char.charCodeAt(0); | |
}); | |
return "eval(String.fromCharCode(" + payload.join(',') + "));"; |
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
test |
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
% Ryan Gee | |
% All Glory to the Hypno-Lamdasaur | |
% Lamda calculus type inference in prolog | |
/* Defining operations */ | |
:- op(90, xfx, '->>'). | |
:- op(100, xfx, '::'). | |
:- op(130, xfx, &). | |
:- op(130, fx, \\). | |
:- op(120, yfx, '..'). |
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
var app = new MyTodo(); | |
app.navigateTo('library'); | |
app.editPage(id); |
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
from selenium import webdriver | |
from selenium.common.exceptions import NoSuchElementException, TimeoutException | |
from selenium.webdriver.support.ui import WebDriverWait | |
import time | |
def main(): | |
chrome = webdriver.Chrome() | |
chrome.get("http://account.dev.squarespace.net/blog/first-post/"); | |
try: |
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
function BinHeap(scoreFunc){ | |
this.data = []; | |
this.scorer = scoreFunc; | |
} | |
BinHeap.prototype = { | |
push: function(element) { | |
this.data.push(element); | |
this.bubbleUp(this.data.length - 1) | |
}, |
NewerOlder