Skip to content

Instantly share code, notes, and snippets.

View ajpinedam's full-sized avatar

Andres Pineda ajpinedam

View GitHub Profile
@EfrainReyes
EfrainReyes / FizzBuzz.cs
Created November 28, 2014 13:42
Fizz Buzz using functional C#
Enumerable.Range(1, 30).Select(num =>
((Func<string[], string>)
(buzz => new string[]{
buzz[((num + 2) % 3) / 2] +
buzz[((num + 4) % 5) / 4 * 2],
""+num
}.First(r => r != "")))(new[] { null, "fizz", "buzz"})
).ToList().ForEach(s => Console.WriteLine(s));
var expect = require("chai").expect;
var cakes = function(recipe, ingredients) {
var result = Math.floor(Object.keys(recipe).map(function(ingredient) {
return ingredients[ingredient] / recipe[ingredient];
}).sort(function(a,b) {
return a - b;
})[0]);
return isNaN(result) ? 0 : result;
@blounty
blounty / Android-CustomMapRenderer.cs
Created February 17, 2015 04:59
Create mapping apps that have amazingly cool custom map tiles with Xamarin.Forms
using System;
using Xamarin.Forms.Maps.Android;
using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using Xamarin.Forms;
using CustomMapTiles;
using CustomMapTiles.Droid.Renderers;
[assembly: ExportRenderer (typeof (CustomMap), typeof (CustomMapRenderer))]
namespace CustomMapTiles.Droid.Renderers
@benvium
benvium / apk-change-version-number.md
Created February 20, 2015 16:14
How to change the version number on an existing APK without re-building

This requires the latest version of apktool.

apktool d $APK_PATH -o $OUTPUT_FOLDER

# Open the apktool.yml text file
# Alter the versionCode and versionName entries

# now rebuild!
apktool build $OUTPUT_FOLDER 
@mlhamel
mlhamel / gist:83c28fa90afcbe96b673
Last active August 29, 2015 14:21
Montreal-Python + pythondotorg: interesting tickets
Pythondotorg at Montreal-Python Project Night
=============================================
The idea is to work on a Django project and to help the Python community by
making the Python website better.
For Installation instructions, please have a look at the following document:
http://htmlpreview.github.io/?https://github.com/mtlpy/pythondotorgdocs/blob/master/build/html/index.html
@NVentimiglia
NVentimiglia / ItemStack.cs
Last active October 31, 2021 21:06
Need a Items control or a repeater for Xamarin ? Here you go. Bind to observable collections, define your data template and enjoy.
// MIT License
// Nicholas Ventimiglia
// 2016-9-19
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active January 1, 2025 13:18
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:

@define-private-public
define-private-public / HttpServer.cs
Last active July 17, 2025 09:09
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@insidegui
insidegui / WebCacheCleaner.swift
Created September 14, 2016 23:12
Clear WKWebView's cookies and website data storage, very useful during development.
import Foundation
import WebKit
final class WebCacheCleaner {
class func clean() {
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast)
print("[WebCacheCleaner] All cookies deleted")
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
@veryhumble
veryhumble / RecyclerViewAdapter.cs
Last active August 5, 2021 19:13
Xamarin.Forms RecyclerView Renderer for Android
using System.Collections;
using System.Diagnostics;
using A11YGuide.Controls;
using A11YGuide.Droid.Helpers;
using A11YGuide.ViewModels.Search;
using Android.Support.V7.Widget;
using Android.Views;
using Android.Widget;
using fivenine.Core.Extensions;
using Xamarin.Forms;