Skip to content

Instantly share code, notes, and snippets.

@ayal
ayal / app.js
Created October 27, 2019 17:30
offer class preferences code
//var prefs = [[2,3],[1,3],[1,2],[5,6],[4,6],[4,5],[8,9],[7,9],[7,8],[11,12],[10,12],[10,11],[14,15],[13,15],[13,14],[17,18],[16,18],[16,17]];
var perfstr = `1 13 16
2 13 18
3 7 10
4 11 16
5 6 9
6 13 5
7 5 6
8 -1 -1
@ayal
ayal / haaretz.js
Last active June 6, 2019 22:13
cleans haaretz articles
javascript:void(
function(){
document.head.innerHTML = '';
var jsCode=document.createElement('script');
jsCode.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js');
document.body.appendChild(jsCode);
setTimeout(()=>{
var art = $('.article');
if (art.length === 0) {
autologin = function(){
var state = Meteor.uuid();
$.get('/_oauth/facebook?close&state=' + state +
'&access_token=' +
FB.getAccessToken(), function() {
Meteor.call('login', {oauth: {state: state}}, function(e, result) {
Accounts._makeClientLoggedIn(result.id, result.token);
var i = 0;
var len = object.length;
objects.forEach(function() {
if (something) {
doSomethingAsync(function(data) {
doSomethingWithData(data);
if (i === len - 1) {
returnResponseToClient();
}
i++;
(defn-log match-rep-loc
"in this context rep-op is the incoming rep-op, rep-loc is what is for comparison from the rep-class from rep-rules"
[rep-op rep-class]
(for [rep-loc rep-class
:when
(cond
(and (:blip-id rep-loc)
(= (:rep-loc rep-op) rep-loc))
false
@ayal
ayal / robot.clj
Created September 21, 2009 14:52 — forked from avital/robot.clj
(ns we
(:require clojure.contrib.json.read)
(:require clojure.contrib.json.write)
(:require clojure.set)
(:use clojure.contrib.json.read)
(:use clojure.contrib.json.write)
(:use clojure.set)
(:use compojure))
; db is a map between replocs and blipData (= the event json we get from wave)