Skip to content

Instantly share code, notes, and snippets.

View berdosi's full-sized avatar

Bálint Erdősi berdosi

View GitHub Profile
function* fibonacci() { var act = 1, prev = 1; while (true) { t = act; yield act = (act + prev); prev = t } }
// not the primes, but binary according to primality
function* primes(){ var n = 2; while(true) {for(var i=2;i<=Math.sqrt(n);i++) if (0==n%i) yield false, ++n; yield true, ++n} }
#!/bin/bash
OUTFILE="$1.pau"
echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--This is a lesson file for Pauker (http://pauker.sourceforge.net)-->
<Lesson LessonFormat="1.7">
<Description/>
<Batch>' > $OUTFILE
sed $1 -e 's#\(.*\)\t\(.*\)# <Card>\n <FrontSide Orientation="LTR" RepeatByTyping="false">\n <Text>\1</Text>\n </FrontSide>\n <ReverseSide Orientation="LTR" RepeatByTyping="false">\n <Text>\2</Text>\n </ReverseSide>\n </Card>#' >> $OUTFILE
echo ' </Batch>
<Batch/>
#!/bin/bash
BELEPES_USERNAME=töltsd_ki
BELEPES_JELSZO=ezt_is
TEMPFILE=`tempfile`
HREF=`curl -isL -c $TEMPFILE www.tvn.hu | grep Location | sed -e "s#.*\(http://.*\)index.tvn#\1iranymondo.tvn#" | tail -n 1`
POSTDATA="belepes_username=${BELEPES_USERNAME}&belepes_jelszo=${BELEPES_JELSZO}&js_autodetect_results=0&just_logged_in=1&varas=tvn.hu&gokep.x=29&gokep.y=8"
curl -sL -b $TEMPFILE -c $TEMPFILE -d $POSTDATA $HREF
rm $TEMPFILE
/*
* Do not remove the @namespace line -- it's required for correct functioning
*/
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
/* a menü jobb szélére pakolom a menüt, és felhúzom oda a toolbar nagy részét. A menü csak akkor lesz teljes méretű, ha az egér fölé ér. TinyMenu extension helyett :) */
menubar {
width: 24px;
overflow: hidden;
}
CmdUtils.CreateCommand({
name: "richtypo",
author: { name: "Balint Erdosi" },
license: "GPL",
description: "Tipo- és ortográfiai korrekciókat végez a textareában kiválasztott szövegen",
takes: {"input": noun_arb_text},
execute: function richTypo(input) {
var str = input.html
.replace(/\.\.\./g,'…')
.replace(/--/g,'–')