Skip to content

Instantly share code, notes, and snippets.

View mogwai's full-sized avatar

Harry Coultas Blum mogwai

View GitHub Profile
@mogwai
mogwai / linkprevention.cs
Created October 8, 2017 16:20
Prevent Linking Method
bool load;
void LinkingPrevention() {
if (load)
try {
// Auth0
var x = new JwtPayload();
} catch (Exception e) {
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Hum.Views.EventListItemView">
<Label Text="{Binding Title}" />
</ViewCell>
@mogwai
mogwai / CurvedSearchBar.cs
Last active October 9, 2017 10:51
Linking with Custom Renderers
using Xamarin.Forms;
namespace MyApp.Views.Controls {
public class CurvedSearchBar : SearchBar {
public static readonly BindableProperty CornerRadiusProperty =
BindableProperty.Create("CornerRadius", typeof(float), typeof(CurvedSearchBar), 0.0f);
public float CornerRadius {
get { return (float)GetValue(CornerRadiusProperty); }
set { SetValue(CornerRadiusProperty, value); }
namespace MyApp.Helpers {
public static class DeviceInformation {
/// <summary>
/// Finds out whether this is a low memory device using a Dependency Service
/// </summary>
[Preserve]
public static bool LowMemoryDevice {
get {
var mem = DependencyService.Get<IMemoryHelper>().GetTotalMemory();
04e96779565af584ce2e9860d36dcb9ba94e63ab97d2bf6a5bee3b610ad1274a2da51d5c279ad66b34c0048dd86abc5847fae708ec8a46da3f49b427feefb2d1ab;MclloydVuong
@mogwai
mogwai / request.js
Created March 9, 2018 12:07
Sending a HTTPS Request
const request = require('request')
const url = "https://sad-poincare-i76vm5gt.vertuozpilot.engie.fr/hemis/rest/WS_UserManagement/login"
const options = {
url: url,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Cache-Control": "no-cache",
"Postman-Token": "314a0757-450b-7889-8c2f-9ca33b3c72a5"
Layout info:
{
"id": "com.apple.keylayout.British-PC",
"lang": "en"
}
isUSStandard: false
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| KeyA | a | A | | A | a | A | [KeyA] | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mogwai
mogwai / setupk3svms.sh
Last active April 4, 2020 11:31
Setup k3s VMs
# Install multipass
sudo snap install multipass --classic
# Launch nodes
multipass launch -n master & multipass launch -n node1 & multipass launch -n node2
# Download, transfer and run master install script
curl -sfL https://get.k3s.io > k3s.sh
multipass transfer k3s.sh master:
multipass exec master bash k3s.sh