Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼
Thinking

Tuğçe Arar stugcearar

🐼
Thinking
View GitHub Profile
@larsneo
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> -->
<script>
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
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
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
JonDouglas / xamarinandroidbindings.md
Last active Nov 20, 2020
Xamarin Android Bindings Troubleshooting
View xamarinandroidbindings.md

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
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
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)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
using System;
@rudyryk
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)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
using System;
@alexrainman
alexrainman / Connectivity.cs
Last active Feb 12, 2020 — forked from emil2k/Connectivity.java
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 {
/**
View nuget.sh
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
@hramos
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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
You can’t perform that action at this time.