Skip to content

Instantly share code, notes, and snippets.

View mourginakis's full-sized avatar
👻

Ioannis Mourginakis mourginakis

👻
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active July 29, 2025 16:47
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@divs1210
divs1210 / multilambda.py
Last active March 25, 2025 04:00
Dead Simple Multiline Lambdas for Python
def do(*body):
return body[-1]
# Example (Python 2)
# =======
map(lambda x: do(
print('x =', x),
x * x),
range(5))
@johnhw
johnhw / umap_sparse.py
Last active May 11, 2025 07:18
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@divs1210
divs1210 / SLIP.py
Last active January 10, 2025 18:29
helps escape the Python's clutch
import types
# Helpers
# =======
def _obj():
'''Dummy object'''
return lambda: None
_FILLER = _obj()
@bsquidwrd
bsquidwrd / fetch_emails.py
Created April 10, 2017 15:42
Fetch Emails with Python
import email
import imaplib
import os
SERVER = 'imap.gmail.com'
USERNAME = 'EMAIL ADDRESS'
PASSWORD = 'PASSWORD'
class FetchEmail():
@claymcleod
claymcleod / pycurses.py
Last active April 28, 2025 17:11
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
@d12frosted
d12frosted / MarIO.lua
Created June 15, 2015 08:14
MarI/O by SethBling
-- MarI/O by SethBling
-- Feel free to use this code, but please do not redistribute it.
-- Intended for use with the BizHawk emulator and Super Mario World or Super Mario Bros. ROM.
if gameinfo.getromname() == "Super Mario World (USA)" then
Filename = "DP1.state"
ButtonNames = {
"A",
"B",
"X",
@SegFaultAX
SegFaultAX / gist:10941721
Last active May 19, 2023 09:20
clojure.walk in Python
from functools import partial
def identity(e):
return e
def walk(inner, outer, coll):
if isinstance(coll, list):
return outer([inner(e) for e in coll])
elif isinstance(coll, dict):
return outer(dict([inner(e) for e in coll.iteritems()]))
@jackrusher
jackrusher / abstract.md
Last active April 8, 2025 08:54
An old programming koan.

The venerable master Qc Na was walking with his student, Anton. Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing - is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil - objects are merely a poor man's closures."

Chastised, Anton took his leave from his master and returned to his cell, intent on studying closures. He carefully read the entire "Lambda: The Ultimate..." series of papers and its cousins, and implemented a small Scheme interpreter with a closure-based object system. He learned much, and