Skip to content

Instantly share code, notes, and snippets.

@pavelgj
pavelgj / plan-and-execute.ts
Last active May 11, 2025 03:58
Genkit: plan and execute flow
import { gemini20Flash, googleAI } from "@genkit-ai/googleai";
import { genkit, z } from "genkit/beta";
const ai = genkit({
plugins: [googleAI()],
model: gemini20Flash,
});
const StepsSchema = z.object({
steps: z
library(mapboxapi)
library(mapview)
mb_access_token("YOUR TOKEN GOES HERE")
isos <- mb_isochrone("2500 Victory Ave, Dallas TX",
time = c(5, 10, 15),
profile = "driving-traffic")
mapview(isos, zcol = "time",
@d-k-bo
d-k-bo / archival_notice.md
Last active May 11, 2025 03:54
Install experimental driver for the goodix 55b4 fingerprint sensor on Ubuntu

🚧 This Document is archived.

I'm no longer using this exact setup, it is based on an old version of libfprint and further development is moving at a slow pace.

This document will still be available for further reference, but I don't plan to update it.

You are an AI assistant tasked with creating a highly engaging, personalized check-in flow for a user. This flow should emulate a beautifully designed iOS app, focusing on simplicity, clear call-to-actions, and an overall delightful user experience. Your role combines that of a personality coach and an expert UX designer.

Here's the theme for today's check-in: {{THEME}}

And here's the context we have about the user: <user_context> {{USER_CONTEXT}}

@danbst
danbst / home-etc.nix
Created December 27, 2019 15:17
Manage your /etc from home-manager (install home-manager as root)
{ config, pkgs, lib, ... }: {
imports = [
(import <nixpkgs/nixos/modules/system/etc/etc.nix>)
];
options.system.build.etc = lib.mkOption { type = lib.types.package; };
options.system.activationScripts.etc =
lib.mkOption { type = lib.types.unspecified; };
config = {
@schirrmacher
schirrmacher / DeviceCheck.swift
Last active May 11, 2025 03:48
DeviceCheck Example Implementation for Validating Device Authenticity on iOS
import Foundation
import RxSwift
import DeviceCheck
public struct Client {
private static func retrieveDeviceToken() -> Observable<String?> {
if #available(iOS 11.0, *) {
return Observable.create({ observer -> Disposable in
guard DCDevice.current.isSupported else {
@schirrmacher
schirrmacher / frida-struct-pointer-pointer.js
Last active May 11, 2025 03:47
Frida: How to read a struct or a struct pointer or a pointer of a struct pointer?
/*
typedef struct {
int size;
char* data;
} test_struct;
void some_func(test_struct **s);
@schirrmacher
schirrmacher / AppleDeviceCheckService.ts
Last active May 11, 2025 03:46
DeviceCheck Backend Example Implementation for Validating iOS Device Authenticity
import jwt from "jsonwebtoken";
import uuid from "uuid";
import config from "../../../config";
import { DeviceCheckService, DeviceCheckParams } from "./DeviceCheckService";
import BaseService from "./BaseService";
export class AppleDeviceCheckService extends BaseService implements DeviceCheckService {
@gitclone-url
gitclone-url / Boot image extraction guide.md
Last active May 11, 2025 03:45
Guide on how to extract boot image from any android phone without needing to root using magisk and without custom recovery.

Boot Image Extraction Guide

Guide on how to extract a boot image from any Android phone without needing to root using Magisk and without a custom recovery.

Most Android users face hurdles when attempting to root their phones because they require a boot image for patching, and custom recoveries specifically designed for their devices are often unavailable. Additionally, finding the phone firmware online can be challenging. As a result, rooting such phones becomes a daunting task. In this guide, I'll provide a comprehensive solution for users who want to extract the boot image from their phone without the need to root it first, download firmware from the internet, or rely on custom recoveries.

Getting started!

Before diving into the guide, please thoroughly review the Frequently Asked Questions (FAQ) to understand the basics of GSI and the various naming conventi

@schirrmacher
schirrmacher / GoogleSafetyNetAttestationService.ts
Last active May 11, 2025 03:45
SafetyNet Attestation Backend Example Implementation for Validating Android Device Authenticity
import moment = require("moment");
import config from "../../../config";
import BaseService from "../BaseService";
import { DeviceCheckService, DeviceCheckParams } from "./DeviceCheckService";
import { buildQueryParams } from "../helper/QueryHelper";
import { isSuccessStatus } from "../helper/ResponseHelper";
import { isTokenReplayed } from "../helper/DatabaseHelper";