Skip to content

Instantly share code, notes, and snippets.

View b099l3's full-sized avatar
🏃‍♂️

Iain Smith b099l3

🏃‍♂️
View GitHub Profile
@b099l3
b099l3 / main.dart
Last active December 22, 2021 21:55
WTF dart?
void main() {
// Careful with filled it will use the same object
//final _map = List.filled(10, List.filled(10, 0));
final _map = List.generate(10, (_) => List.generate(10, (_) => 0));
_map[1][1] = 1;
_map[0][1] = 1;
print('This is madness ${_map[1][2] == 1 ? 'yes' : 'no'} ');
import 'package:flutter/material.dart';
Map<int, Color> color = {
50: Color.fromRGBO(136, 14, 79, .1),
100: Color.fromRGBO(136, 14, 79, .2),
200: Color.fromRGBO(136, 14, 79, .3),
300: Color.fromRGBO(136, 14, 79, .4),
400: Color.fromRGBO(136, 14, 79, .5),
500: Color.fromRGBO(136, 14, 79, .6),
600: Color.fromRGBO(136, 14, 79, .7),
@b099l3
b099l3 / MultiTarget.csproj
Last active February 26, 2020 14:58
Multi Target for Xamarin, you need to add the global.json file too
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;netcoreapp3.0;MonoAndroid90;MonoAndroid10.0;Xamarin.iOS10</TargetFrameworks>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0.0</Version>
<PackageVersion>1.0.0.0</PackageVersion>
<PackOnBuild>true</PackOnBuild>

Used to create a list of dummy items

public List<Item> Items { get; set; } = Enumerable.Range(1, 200)
                                                  .Select(i => new Item 
                                                  { 
                                                      AutomationId = i, 
                                                      Label = $"Option Number {i}" 
                                                  }).ToList();
@b099l3
b099l3 / Branches.txt
Last active November 1, 2018 11:49
Branch stats
// List all branches in last commit date order
git for-each-ref --sort=committerdate refs/remotes/ --format='%(committerdate:short) %(refname:short)'
// List all branches in last commit date order with last comitter name
git for-each-ref --sort=committerdate refs/remotes/ --format='%(committerdate:short) %(committername) %(refname:short)'
// List all branches that have been merged including local branches sorted by commiter date desc
git branch -a --sort=committerdate --merged
You can check the entitlements needed by your app using the following command in Terminal. When you unzip your .ipa file, you will get the Payload folder. Navigate to the same directory the Payload folder is in before executing the command:
>codesign -d --entitlements :- "Payload/YourApp.app"
Then, you can check what entitlements are included in the provision with
>security cms -D -i "Payload/YourApp.app/embedded.mobileprovision"
This output can help show where the mismatch is.
{"v":"4.6.2","fr":25,"ip":0,"op":104,"w":1921,"h":1082,"nm":"Fringe_logo - fast - converted to shapes","ddd":0,"assets":[{"id":"comp_2","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"s22 Outlines","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[1178.155,711.465,0]},"a":{"a":0,"k":[357.943,166.113,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"ef":[{"ty":5,"nm":"Linear Wipe","mn":"ADBE Linear Wipe","ix":1,"en":1,"ef":[{"ty":0,"nm":"Transition Completion","mn":"ADBE Linear Wipe-0001","ix":1,"v":{"a":0,"k":0}},{"ty":0,"nm":"Wipe Angle","mn":"ADBE Linear Wipe-0002","ix":2,"v":{"a":0,"k":248}},{"ty":0,"nm":"Feather","mn":"ADBE Linear Wipe-0003","ix":3,"v":{"a":0,"k":50}}]}],"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-148.492,25.096],[0,0],[81.202,-23.737],[129.619,-51.908],[0,0],[0,0],[0,0],[-55.788,16.243]],"o":[[0,0],[-154.917,26.314],[-59.314,17.064],[0,0],[0,0],[0,0],[125.964,-50.229],[75.338,-21.947]],"v":[[357.693,-26.193],[334.249,-165.862],[-19.93,-90.785],[-303.33,12.672],[-357.
@b099l3
b099l3 / gist:2cb4d924cb2c166b5cc41c97a3509df0
Last active October 10, 2017 10:46
Add Reveal to Xamarin project
@b099l3
b099l3 / WCSessionManager.cs
Last active October 17, 2023 21:06
A Session manager for watchOS and iOS xamarin. Can be used in both xamarin.iOS and xamarin.watchOS
using System.Collections.Generic;
using System.Linq;
using Foundation;
using Newtonsoft.Json;
using System;
namespace WatchConnectivity
{
public sealed class WCSessionManager : WCSessionDelegate
{
#!/bin/bash
incrementBuildnumber ()
{
echo "\n ********************** Build Number++ Started ********************** \n"
BRANCH_NAME=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
git symbolic-ref --short HEAD
git reset --hard origin/$BRANCH_NAME
git branch --set-upstream-to=origin/$BRANCH_NAME $BRANCH_NAME
git pull