Skip to content

Instantly share code, notes, and snippets.

View simonbengtsson's full-sized avatar

Simon Bengtsson simonbengtsson

View GitHub Profile
@simonbengtsson
simonbengtsson / d1_kv_api_wrapper.ts
Last active May 30, 2025 05:32
D1 wrapper with kv+ api
export type Document = z.infer<typeof Document>
export const Document = z.object({
id: z.string(),
})
export type User = z.infer<typeof User>
export const User = Document.extend({
name: z.string(),
email: z.email(),
})
@simonbengtsson
simonbengtsson / bluetoothPlayground.swift
Created August 6, 2022 17:35
Playground code for advertising and scanning bluetooth
import Foundation
import CoreBluetooth
class BluetoothScanner: NSObject, CBCentralManagerDelegate {
private var centralManager: CBCentralManager!
override init() {
super.init()
centralManager = CBCentralManager(delegate: self, queue: nil)
@simonbengtsson
simonbengtsson / MainActivity.kt
Created January 23, 2020 20:28
Check for Google Play services
class MainActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
if (checkGooglePlayServices()) {
startActivity(Intent(this, HomeActivity::class.java))
}
}
private fun checkGooglePlayServices(): Boolean {
@simonbengtsson
simonbengtsson / Podfile
Created June 1, 2018 07:43
Podfile for react native and swift
target 'Equilab' do
platform :ios, '10.0'
use_frameworks!
inhibit_all_warnings!
pod 'Charts'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'Realm'
'use strict';
var gulp = require('gulp');
var PUBLIC_PATH = "../parse/public";
gulp.task('default', ['develop']);
gulp.task('develop', ['testing']);
gulp.task('build', ['testing']);