Skip to content

Instantly share code, notes, and snippets.

View dalexsoto's full-sized avatar

Alex Soto dalexsoto

View GitHub Profile
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 3, 2024 12:59
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@dalexsoto
dalexsoto / HttpClientProgressExtensions.cs
Last active April 3, 2024 15:01
Add Progress reporting to capabilities to HttpClient
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace HttpClientProgress {
public static class HttpClientProgressExtensions {
public static async Task DownloadDataAsync (this HttpClient client, string requestUrl, Stream destination, IProgress<float> progress = null, CancellationToken cancellationToken = default (CancellationToken))
{
@yamaya
yamaya / xcode-clang-vers
Last active April 3, 2024 02:28
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active March 12, 2024 10:36
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@praeclarum
praeclarum / EasyLayout.cs
Last active April 21, 2023 10:28
**OUT OF DATE** Please use the NuGet package https://www.nuget.org/packages/EasyLayout or the code on GitHub https://github.com/praeclarum/EasyLayout. (EasyLayout makes writing auto layout code in Xamarin.iOS easier. See [the example](https://gist.github.com/praeclarum/8185036) for hints on how to use this library.)
//
// Copyright (c) 2013-2015 Frank A. Krueger
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@cabeca
cabeca / simulator_populator
Created September 23, 2014 21:30
This script removes and recreates all simulators in Xcode 6.
#!/usr/bin/env ruby
device_types_output = `xcrun simctl list devicetypes`
device_types = device_types_output.scan /(.*) \((.*)\)/
runtimes_output = `xcrun simctl list runtimes`
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/
devices_output = `xcrun simctl list devices`
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/
@praeclarum
praeclarum / AutoLayout.fs
Last active April 27, 2020 11:07
AutoLayout wrapper to make creating constraints in F# easier
module Praeclarum.AutoLayout
open System
#if __IOS__
open Foundation
open UIKit
type NativeView = UIView
#else
open Foundation
@davidfowl
davidfowl / IsPalindrome.cs
Created February 2, 2020 22:59
Works for surrogate pairs
static bool IsPalin(string s)
{
var bi = s.Length - 1;
foreach (var r in s.EnumerateRunes())
{
if (!Rune.TryGetRuneAt(s, bi - (r.Utf16SequenceLength - 1), out var b) || !r.Equals(b))
{
return false;
}
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace HexagonApp {
[Register ("AppDelegate")]
class AppDelegate : UIApplicationDelegate {
UIWindow window;
public override bool FinishedLaunching (UIApplication app, NSDictionary options) {