Skip to content

Instantly share code, notes, and snippets.

import { expect } from 'chai';
import hre from "hardhat";
const { ethers } = hre;
async function deployContract(name, args = []) {
const Factory = await ethers.getContractFactory(name);
const contract = await Factory.deploy(...args);
await contract.waitForDeployment();
return contract;
}
@Alex-Werner
Alex-Werner / grpo_demo.py
Created January 31, 2025 09:51 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@Alex-Werner
Alex-Werner / gist:0c81008cd41bb11e83a52fc8791a94f8
Created July 3, 2024 13:02
Have specific user commit after PR merge on branch
name: Bump Version and Commit and tag
on:
push:
branches:
- release/testnet
jobs:
bump-version:
if: "!contains(github.event.head_commit.message, 'chore(release):')"
@Alex-Werner
Alex-Werner / gist:3cabab2ba09ea749a4c38b70326f9acf
Last active January 16, 2023 14:45
Moleculer JS NATS and Scaleway Messenging JS Code
const { ServiceBroker } = require('moleculer');
const { credsAuthenticator } = require('nats');
// Format of process.env.CREDENTIALS
// -----BEGIN NATS USER JWT-----
// ...
// ------END NATS USER JWT------
// -----BEGIN USER NKEY SEED-----
// SUAF...
// ------END USER NKEY SEED------
@Alex-Werner
Alex-Werner / git.migrate
Created August 10, 2020 13:17 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@Alex-Werner
Alex-Werner / index.js
Last active November 3, 2017 13:08
Use bitcore-node-dash as dependencies
const bitcore = require('bitcore-node-dash');
const start = bitcore.scaffold.start;
let config = {
"network": "testnet",
"port": 3001,
"services": [
"bitcoind"
],
"servicesConfig": {
"bitcoind": {
[Unit]
Description=Bitcore Server Testnet
#Requires=After=dashd.service
[Service]
PIDFile=/home/obusco/.pids/bitcore.pid
ExecStart=/home/obusco/insight/bitcore-node-dash bin/bitcore-node-dash start > /home/obusco/.logs/bitcore.log
Restart=always
RestartSec=10
[Unit]
Description=Dashd Service
After=networking.service
[Service]
PIDFile=/home/obusco/.pids/dashd.pid
ExecStart=/home/obusco/dashcore/github/dash/src/dashd -daemon
ExecStop=/home/obusco/dashcore/github/dash/src/dash-cli stop
KillMode=process
- Install local dashcore version.
- Create dash.conf file in .dashcore with data allowing to be requested by RPC (server=1, rpcport,... - You can use exemple [REF1] below)
- Start dashd by simply call for ./bin/dashd
- Then in another folder (insight?) do a git clone https://github.com/dashevo/bitcore-node-dash -b skip-dash-download
- cd bitcore-node-dash
- npm install
- npm install insight-api-dash --S
- npm install insight-ui-dash --S
@Alex-Werner
Alex-Werner / gist:255f709b5942256d0b4152ca80f36421
Last active August 7, 2017 23:07
The New Economic Crash ?
Predicting new crash soon as per :
- Banco Popular bank run in Espana who died in June 2017 (2bn € per day where moved out). It was the third biggest bank in Espana (1700 agency).
- Stress-test are shit (as Banco Popular has passed them easily).
- Banco Popular has been bought for 1€ by Santander (first bank of the country), so the debt are still existing by has switch of hands.
- European Union to block account during 20 days to avoid bankrun
- Otmar Issing (German economist, 1 of the father of the Euro and previously Member of Executive comitee@BCE) said "The card-castle will collapse"
he also said the WirschaftsWoche journal "The crisis is not over", but this can be understand by seing what has really changes since 2008 (actually nothing, it's worse).
- Junk-bonds are now representing ~1 000 bns €.
- 114 of the 500 italian bank are near the end (Fitch)