Skip to content

Instantly share code, notes, and snippets.

View jamesmoriarty's full-sized avatar
🔮
0xc0000005

James Moriarty jamesmoriarty

🔮
0xc0000005
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active April 21, 2025 18:48
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
@jamesmoriarty
jamesmoriarty / http-connect-proxy.rb
Last active September 26, 2021 00:25
HTTP CONNECT by example
require 'socket'
listen_socket = TCPServer.new('127.0.0.1', 9292)
client_conn = listen_socket.accept
request_line = client_conn.gets
while(line = client_conn.gets) do
break unless line.include?(':')
end
@imantung
imantung / ast_print_struct_fields.go
Created June 3, 2020 11:07
Print struct field using golang AST
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
)
var src = `package mypackage
@IanColdwater
IanColdwater / twittermute.txt
Last active April 14, 2025 16:31
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@gregbuehler
gregbuehler / docker-compose.yml
Created March 2, 2019 00:00
Observability Compose
---
version: "3"
services:
# utility
ouroboros:
image: pyouroboros/ouroboros
container_name: ouroboros
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
@robrichard
robrichard / persistedQuery.js
Last active January 8, 2019 00:09
express-graphql persisted query
const express = require('express');
const bodyParser = require('body-parser');
const graphqlHTTP = require('express-graphql');
const app = express();
app.use(bodyParser.json());
async function getPersistedQueryMiddleware(req, res, next) {
if (!req.body.id) {
next();
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active April 16, 2025 20:12
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 17, 2025 09:00
set -e, -u, -o, -x pipefail explanation
@nadavrot
nadavrot / Matrix.md
Last active April 20, 2025 12:59
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@jed
jed / deploy.sh
Last active April 24, 2024 15:45
Using AWS CloudFormation to deploy an edge lambda
#!/bin/sh
aws cloudformation deploy \
--template-file stack.yaml \
--stack-name edge-lambda-test \
--capabilities CAPABILITY_IAM \
--parameter-overrides Nonce=$RANDOM