Skip to content

Instantly share code, notes, and snippets.

@miguelmartin75
miguelmartin75 / config.nims
Last active May 10, 2025 20:00
Example of Nim with Objective-C, issue: https://github.com/nim-lang/Nim/issues/9492. Compile with `nim withArc` to execute using Objective-C's ARC and `nim withoutArc` to depend on Nim's ARC to call release
--outdir:"build"
--nimcache:"build/cache"
when defined(useObjcArc):
--passC:"-fobjc-arc"
else:
--passC:"-fno-objc-arc"
task withArc, "compile and run with arc":
exec "nim objc --listCmd -d:useObjcArc -r guts.nim"
@miguelmartin75
miguelmartin75 / buildsupport.nim
Created March 23, 2025 00:00
compile commands json generation for nim in nimscript
import std/[
os,
json,
tables,
options,
strformat,
strutils,
sugar,
sequtils,
]
@miguelmartin75
miguelmartin75 / README.md
Last active September 28, 2024 10:46
json parse CLI example in nim, from https://x.com/lemire/status/1839881289312149549

SETUP:

Install nim

REPO_PATH=$HOME/repos
cd $REPO_PATH
git clone [email protected]:nim-lang/Nim.git
cd Nim
./build_all.sh
@miguelmartin75
miguelmartin75 / requirements.txt
Last active April 24, 2023 18:52
Segment Anything with text or images (CLIP used). Fork of https://huggingface.co/spaces/curt-park/segment-anything-with-clip
gradio
torch
git+https://github.com/facebookresearch/segment-anything.git
git+https://github.com/openai/CLIP.git
opencv-python
@miguelmartin75
miguelmartin75 / conversions.md
Last active May 23, 2020 07:59
(approximate) cup change (and tablespoon + teaspoon) for developing film with US cup for Rollei Colorchem C-41 kit

Chemicals

Rollei Colorchem C-41 kit Manual

This is converted for for US measurements. I will also have my develop times on here.

Colour Developer Mixing Instructions (Converted)

Page 7 of the manual converted. This assumes you have the following US-based measurement devices:

from keras.utils import plot_model
from keras.models import Model
from keras.layers import Input, Dense, concatenate
def create_inner_model():
input=Input((10,))
d1 = Dense(128)(input)
d2 = Dense(64)(d1)
@miguelmartin75
miguelmartin75 / tuple_type_wrapper_thing.cpp
Created August 25, 2014 13:51
basically converts std::tuple<T1, T2, ..., TN> to std::tuple<X<T1>, X<T2>, ..., X<TN>>, hue.
#include <iostream>
#include <tuple>
template<template <typename T> class X>
struct Wrap
{
template <typename T, typename... Args>
struct Deducer
{
typedef decltype(std::tuple_cat(std::tuple<X<T>>(), typename Deducer<Args...>::tuple())) tuple;
@miguelmartin75
miguelmartin75 / insertion_sort.cpp
Last active August 29, 2015 14:03
sorting algorithms, heh.
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
template <typename RandomIt>
void insertion_sort(RandomIt begin, RandomIt end)
{
// loop through all the elements, from
// the the second element to the last.
@miguelmartin75
miguelmartin75 / intostr.cpp
Last active August 29, 2015 14:02
add vs lookup table
#include <chrono>
#include <cstdint>
#include <iostream>
#include <random>
#include <sstream>
using namespace std;
typedef std::chrono::microseconds time_unit;
static const std::string time_unit_suffix{"us"};