Skip to content

Instantly share code, notes, and snippets.

View davidaparicio's full-sized avatar
🚀
Seeking challenging projects 🚀

David Aparicio davidaparicio

🚀
Seeking challenging projects 🚀
View GitHub Profile
@davidaparicio
davidaparicio / grpo_demo.py
Created March 12, 2025 20:34 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Advent of Code template by @MathisHammel
# TODO
# - Make a snapshot of the file when a submission is correct
# - Display the rank when submission is accepted
# - Utility function to rotate/flip a 2D array
# - Cycle length detector/extrapolator to make loops faster
# - Put examples in cache
# - Warning if DAY is not the current day
@davidaparicio
davidaparicio / wget_aula.sh
Created December 6, 2022 13:44
Bash script to download all courses from a website like MIT OCW (MIT OpenCourseWare)
#!/bin/bash
#Date uploaded 4/30/2013, 2:21 PM
#Henrique CTRL+L (clear), cd - (prev)
#David CTRL+R (reverse search), CTRL+G (clear the search)
#http://en.kioskea.net/faq/1757-how-to-read-a-file-line-by-line
old_IFS=$IFS # save the field separator
IFS=$'\n' # new field separator, the end of line
Feature: bank account
A user's bank account must be able to withdraw and deposit cash
Moreover, as the user is rich, with a very large estate, and a lot of vast networking,
The bank tolerates having an overdrawn account, thank to expensive overdraft charges
Scenario Outline: Deposit
Given I have a bank account with <start>$
When I deposit <deposit>$
Then it should have a balance of <end>$
@davidaparicio
davidaparicio / keybase.md
Created January 15, 2022 18:45
Proof of my GitHub identity

Keybase proof

I hereby claim:

  • I am davidaparicio on github.
  • I am dadideo (https://keybase.io/dadideo) on keybase.
  • I have a public key whose fingerprint is 78DE 333D EEEE 509C 2C06 0C70 6177 5B70 C2EC E26B

To claim this, I am signing this object:

@davidaparicio
davidaparicio / .git_commit_msg
Created November 21, 2020 12:28
emoji-commit-message
# ^--^ ^------------^
# | +-> Summary in present tense.
# +-------> Type: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, or test
# ✨ feat: new feature for the user, not a new feature for build script
# 🐛 fix: a bug fix or 💥 crash fix or 🚱 memory leak
# 📚 docs: 📝 changes to the documentation only
# 💎 style: 👕 formatting, white-space, etc; no production code change
# 🔨 refactor: 👌 code change that does not fix a bug or add a feature, eg. renaming a variable
# 🚀 perf: 🐎 code change that improves performance
# 🚨 test: ✅ adding missing tests, refactoring tests; no production code change
@davidaparicio
davidaparicio / maintenance.html
Last active February 4, 2020 08:55 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<html>
<head>
<title>Site Maintenance</title>
<meta charset="utf-8"/>
<meta name="robots" content="noindex"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
@davidaparicio
davidaparicio / bobp-python.md
Created December 3, 2019 13:59 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@davidaparicio
davidaparicio / TwitterBotSearch.java
Created August 26, 2016 13:32
TwitterAPI search with Twitter4j
import twitter4j.*;
import twitter4j.conf.ConfigurationBuilder;
public class TwitterBot {
private final static int TWEETS_IN_PAGE = 100;
public static void main(String[] args) {
//Read the twitter4j.properties
ConfigurationBuilder cb = new ConfigurationBuilder();
try {