Skip to content

Instantly share code, notes, and snippets.

View morisono's full-sized avatar

morisono

View GitHub Profile
@morisono
morisono / README.md
Created February 13, 2025 08:29 — forked from joeblackwaslike/How-to-Python-in-Cursor.md
How to use python with the Cursor IDE

How to use python with the Cursor IDE

We are going to edit cursors settings to point to the microsoft extensions marketplace.

  1. Remove all extensions and exit Cursor.
  2. Locate your Cursor project.json file depending on your platform and open it.
    • On MacOS: /Applications/Cursor.app/Contents/Resources/app/product.json
    • On Windows: C:\Users\<user_name>\AppData\Local\Programs\cursor\resources\app\product.json
    • On Linux: /usr/lib/code/product.json
  3. Locate the object value for key extensionsGallery in the json document.
@morisono
morisono / A.markdown
Created February 10, 2025 11:43 — forked from larrybotha/A.markdown
Export multiple artboards in Adobe Illustrator to png, or pdf

Export multiple Adobe Illustrator artboards to png, jpg, pdf

This is a reference to Matthew Ericson's article Export Illustrator Layers and/or Artboards as PNGs and PDFs in case something happens to happen to the article, and if I just forget where to find the exporter online.

Usage

  • Drop MultiExporter.js into /Applications/Adobe\ Illustrator\ CS6/Presets.localized/en_GB/Scripts
  • Restart Illustrator
@morisono
morisono / EpsBulkConvertSVG.js
Created February 10, 2025 11:42 — forked from scootcho/EpsBulkConvertSVG.js
adobe illustrator EPS to SVG bulk conversion
/**********************************************************
DESCRIPTION
This sample gets files specified by the user from the
selected folder and batch processes them and saves them
as SVGs in the user desired destination with the same
@morisono
morisono / README.md
Created February 10, 2025 11:34 — forked from JohannesDeml/README.md
Batch convert images with inkscape on windows

Batch convert svg|pdf|eps|emf|wmf|ai|ps|cdr to eps|pdf|png|jpg|tiff|svg|ps|emf|wmf

Screenshot Batch converter for Windows using Inkscape with the command line
InkscapeBatchConvert is an easy to use solution to quickly convert all files of a folder to another type without the need to open Inkscape. The program uses Windows Batch scripting and will only work on Windows.
Tested with Inkscape 1.0.x - 1.3.x ✅ (The last version that supports Inkscape 0.9.x can be found here)

Usage

  1. Download _InkscapeBatchConvert.bat
  2. Put it in the folder where you have files you wish to convert (will also scan on all subfolders for files of input type).
  3. Then double click the file to start it.
@morisono
morisono / jq-cheetsheet.md
Created February 10, 2025 08:17 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@morisono
morisono / Export-GitHub-Issues.ps1
Created February 7, 2025 11:09 — forked from Slivicon/Export-GitHub-Issues.ps1
Export GitHub issues, images and comments to offline files with an index, using the GH CLI
# Useful for scenarios where you need to have a snapshot of private repo issues exported offline
#
# 1. Download and install the GH CLI https://github.com/cli/cli
# 2. Save this script
# 3. Start a PowerShell CLI and navigate to the folder with the script
# 4. Run ".\Export-GitHub-Issues.ps1" "RepoOwner/Name" "Label"
# 5. It will prompt you to do a device login to your GitHub account to authorize GH CLI
# 6. It will download the issues and comments tagged with the label specified
# in the repo specified (as long as it is readable by your account)
# 7. It will download any images in the issue body or comments
@morisono
morisono / cursor
Last active February 5, 2025 12:20 — forked from swayducky/cursor
This fixes using "cursor" command in WSL
#!/usr/bin/env sh
# LATEST VERSION OF THIS SCRIPT: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4
# FORKED FROM: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394
# 1) No longer has a hard-coded COMMIT
# 2) Auto-symlinks a "code" script to avoid wslCode.sh breaking
# HOW TO INSTALL:
# 1) Remove "c:\Users\<USER_NAME>\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings
# 2) Modify this script with your Windows <USER_NAME> (NOT your WSL username) in the VSCODE_PATH variable
@morisono
morisono / grpo_demo.py
Created February 1, 2025 20:41 — 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
@morisono
morisono / cut_silence.py
Created January 25, 2025 21:31 — forked from vivekhaldar/cut_silence.py
Python script to cut out silent parts from a video. Uses moviepy.
#!/usr/bin/env python
#
# Based on a script by Donald Feury
# https://gitlab.com/dak425/scripts/-/blob/master/trim_silenceV2
# https://youtu.be/ak52RXKfDw8
import math
import sys
import subprocess
import os
@morisono
morisono / 0.README.md
Created January 23, 2025 13:51 — forked from agentcooper/0.README.md
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation