Skip to content

Instantly share code, notes, and snippets.

View DaveAldon's full-sized avatar
📱
Working on the next great mobile app!

David Crawford DaveAldon

📱
Working on the next great mobile app!
View GitHub Profile

Estimation

This document is an attempt to pin down all the things you don't think about when quoting for a project, and hopefully provide a starting point for some kind of framework to make quoting, working and delivering small-medium jobs more predictable and less stressful.

Contents

#import <React/RCTBridgeModule.h>
#import <HomeKit/HomeKit.h>
#import "React/RCTEventEmitter.h"
@interface RCT_EXTERN_MODULE(HomeKitModule, RCTEventEmitter)
RCT_EXTERN_METHOD(listHomes: (NSString *)name withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
RCT_EXTERN_METHOD(addAndSetupAccessories: (NSString *)name withResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
@mauricedb
mauricedb / Subject under test
Last active December 7, 2023 14:46
Testing stateful React hooks
import { useState } from 'react';
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
return [count, () => setCount(count + 1)];
}
@matthewzring
matthewzring / markdown-text-101.md
Last active October 19, 2025 19:36
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@VeraZab
VeraZab / LocalNotifications.js
Last active February 26, 2023 23:26
Simple local notification with Expo
import React, {Component} from 'react';
import {TextInput, View, Keyboard} from 'react-native';
import {Constants, Notifications, Permissions} from 'expo';
export default class Timer extends Component {
onSubmit(e) {
Keyboard.dismiss();
const localNotification = {
title: 'done',

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@Koloss0
Koloss0 / Corwin
Created March 26, 2017 22:05
A 3D game for the Codea app
--# Main
-- Dimensions of screen: 1024,768
Worlds = {}
function Worlds.addTri(pos1,pos2,pos3,addTex,col,world)
local col,world = color(255),Worlds.town
local m = world.mesh
do
verts = m.vertices
verts[#verts+1],verts[#verts+2],verts[#verts+3] = pos1,pos2,pos3
@lopspower
lopspower / README.md
Last active October 21, 2025 04:50
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@marcuslilja
marcuslilja / clean-osx-install.md
Last active June 9, 2025 08:14
Clean Install – macOS Mojave (10.14)

macOS Sonoma (10.15)

To be able to install all applications. We need to unlock the "Anywhere" setting in Gatekeeper.

sudo spctl --master-disable

Applications