Skip to content

Instantly share code, notes, and snippets.

@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@hortonew
hortonew / setup-bevy-0.15-project-for-android.sh
Last active March 5, 2025 07:02
setup-bevy-0.15-project-for-android.sh
#!/bin/zsh
# Grab PROJECT from Cargo.toml project.name
PROJECT=$(grep "name" Cargo.toml | cut -d '"' -f 2 | head -n 1)
PROJECT_ORG="bevyengine"
PROJECT_ORG_STRUCTURE="org.${PROJECT_ORG}.${PROJECT}"
BEVY_RELEASE="refs/heads/release-0.15.2"
echo "Creating new Bevy project: ${PROJECT} with organization structure: ${PROJECT_ORG_STRUCTURE}"
@kmcquade
kmcquade / jenkins-decrypt.md
Last active March 5, 2025 07:01 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password

To Decrypt Jenkins Passwords

  1. Go to the "Configure System" screen.
  2. Right click on a password field, Inspect element, then change to "text" instead of "password".
  3. Copy that field and then go to the Script Console. Paste the below into the field, replace with your encrypted password, and then hit "run".
encrypted_pw = '{your_encrypted_password_with_brackets_around_it}'
passwd = hudson.util.Secret.decrypt(encrypted_pw)
println(passwd)
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active March 5, 2025 07:00
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 5, 2025 06:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@marjanmo
marjanmo / pygrib_wrapper_example.py
Last active March 5, 2025 06:56
PYGRIB wrapper for reading and filtering grib files - with examples
"""
A set of my pandas-like wrappers around pygrib.open() and pygrib.select() functionality that I find it bit more
intuitive and useful for my workflow. It also contains a patch to the "GRIB API stepUnits error" when reading gribs
with stepUnits below 1 hour.
DEPENDECIES: Numpy, Pandas and of course pygrib (with GRIB API C library available on system!).
Use at your own risk. Any corrections, suggestions, improvements and comments welcome!
Author: Marjan Moderc, Slovenian Environment Agency (ARSO), 2017 (email: [email protected])
@fewwwww
fewwwww / config.md
Created May 18, 2024 04:58
常熟阿诺 GPT
@qin-yu
qin-yu / configure-git.md
Last active March 5, 2025 06:52
Configure Git and setup GitHub on new machine
@willccbb
willccbb / grpo_demo.py
Last active March 5, 2025 06:51
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
@AgentOak
AgentOak / youtube_formats.md
Last active March 5, 2025 06:50
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4