Skip to content

Instantly share code, notes, and snippets.

View wcoder's full-sized avatar
🎯
Focusing

Yauheni Pakala wcoder

🎯
Focusing
View GitHub Profile
@wcoder
wcoder / stations.json
Last active February 17, 2021 10:52
Railway stations. For app development only
[
{
"id": "1",
"ru": "443 км",
"be": "443 км",
"be_lat1": "443 km",
"be_lat2": "443 km"
},
{
"id": "2",
public static void RemoveFacebookCookies()
{
var websiteDataTypes = WKWebsiteDataStore.AllWebsiteDataTypes;
WKWebsiteDataStore.DefaultDataStore.FetchDataRecordsOfTypes(websiteDataTypes, (NSArray records) =>
{
for (nuint i = 0; i < records.Count; i++)
{
var record = records.GetItem<WKWebsiteDataRecord>(i);
if (record.DisplayName.Contains("facebook"))
{
@wcoder
wcoder / ManagedReference.extension.js
Created February 28, 2020 08:25
DocFX custom template for aggregate namespaces by assembly/components.
exports.preTransform = function (model) {
transformItem(model, 1);
return model;
function transformItem(item, level) {
var log = "====================================================\n";
var isAssembly = item.parent == null && item.assemblies.indexOf(item.uid) !== -1;
@wcoder
wcoder / ssl-pinning.cs
Last active December 12, 2019 12:47
Sample of SSL-pinning via NSUrlSession for Xamarin.iOS.
internal static class Samples
{
public static void MakeRequest()
{
var s = "https://secure-domain.org";
var request = new NSMutableUrlRequest(new NSUrl(s))
{
HttpMethod = "GET"
};
@wcoder
wcoder / jquery-1.10.2.min.js
Created October 22, 2019 22:18
404 Page Galaxy Sample
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("o
DEVICE_NAME="iPhone 11"
APP_BUNDLE_ID="com.softeq.Playground-iOS"
# Device ID
DEVICE_UDID=$(xcrun simctl list devices iphone available | grep "${DEVICE_NAME} (" | sed -e 's/^.*(\(.*\)) (.*$/\1/')
echo "DEVICE_ID=${DEVICE_UDID}"
# Boot device
xcrun simctl boot $DEVICE_UDID
@wcoder
wcoder / xamarin_ios_launch_terminal.md
Created October 17, 2019 11:41
Snippets for launch ios app on device/simulator via terminal.

From VS4Mac & Rider:

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch \
--sdkroot /Applications/Xcode.app/Contents/Developer \
--devname "<DEVICE_NAME>" \
--killdev <APP_BUNDLE_NAME> \
--launchdev <PROJECT_PATH>/bin/iPhone/Debug/<PROJECT_NAME>.app \
--wait-for-unlock \
--argument=-connection-mode\
--argument=usb -sdk 10.0 \
@wcoder
wcoder / DotsIndicator.cs
Last active July 14, 2021 15:33
Xamarin Android DotsIndicator View
using System;
using Android.Content;
using Android.Graphics;
using Android.Graphics.Drawables;
using Android.Runtime;
using Android.Util;
using Android.Widget;
namespace DroidDotIndicator
{
@wcoder
wcoder / AutoScrollLabel.cs
Last active July 14, 2021 15:35
Simple AutoScroll UILabel for Xamarin.iOS
using CoreGraphics;
using Foundation;
using System;
using UIKit;
namespace YPControls.iOS
{
[Register("AutoScrollLabel")]
public class AutoScrollLabel : UIScrollView
{