Skip to content

Instantly share code, notes, and snippets.


Tuğçe Arar stugcearar

View GitHub Profile
larsneo / viewer.html
Last active Nov 17, 2020 — forked from jsprpalm/viewer.html
Pinch zoom implementation for PDF.js viewer
View viewer.html
<!-- Goes into viewer.html just before ending </body> -->
let pinchZoomEnabled = false;
function enablePinchZoom(pdfViewer) {
let startX = 0, startY = 0;
let initialPinchDistance = 0;
let pinchScale = 1;
const viewer = document.getElementById("viewer");
const container = document.getElementById("viewerContainer");
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; };
insidegui / WebCacheCleaner.swift
Created Sep 14, 2016
Clear WKWebView's cookies and website data storage, very useful during development.
View WebCacheCleaner.swift
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
dakeshi / Clean web data in WKWebView
Created Jun 10, 2016
Use an default WKWebView save all caches, cookies data in the app. So it make very critical issue such as infinite increase app size.
View Clean web data in WKWebView
/// In AppDelegate.swift
/// Execute remove webdata method when the app receives the memory warning.
/// We can not avoid the infinitely get increased the app size issue
/// when users keep the web searching using the WKWebView.
/// So, you would get iOS full storage message.
/// Set WKWebsiteDataStore.nonPersistentDataStore in the configuration
/// can make lightweight WKWebView. But it can not apply every web site.
/// Imagine the web sites used the localStorage, IndexedDB features.
JonDouglas /
Last active Nov 20, 2020
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:

brianmed / gist:4e458d9116889b798a8c
Last active Feb 5, 2017
Xamarin Forms custom webView renderer with activity load
View gist:4e458d9116889b798a8c
In Shared code:
public class WebViewPage : ContentPage
await Navigation.PushAsync (new WebViewPage());
rudyryk / Badge.cs
Last active Feb 25, 2020
C# — Xamarin.Forms custom simple badge view + rounded box view via custom renderer
View Badge.cs
// Badge.cs
// Created by Alexey Kinev on 19 Jan 2015.
// Licensed under The MIT License (MIT)
// Copyright (c) 2015 Alexey Kinev <>
using System;
rudyryk / Countdown.cs
Last active Nov 1, 2020
C# — countdown timer with periodical ticks + Xamarin.Forms binding helper + Basic usage example
View Countdown.cs
// Countdown.cs
// Created by Alexey Kinev on 11 Jan 2015.
// Licensed under The MIT License (MIT)
// Copyright (c) 2015 Alexey Kinev <>
using System;
alexrainman / Connectivity.cs
Last active Feb 12, 2020 — forked from emil2k/
Check device's network connectivity and speed for Xamarin.Android
View Connectivity.cs
using System.Threading;
using Android.Content;
using Android.Net;
using Android.Telephony;
using Java.IO;
using Java.Net;
namespace YourNamespace {
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
hramos / manifest.plist
Created Jan 11, 2011
Sample manifest file for Over The Air iOS deployment
View manifest.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
You can’t perform that action at this time.