Skip to content

Instantly share code, notes, and snippets.

View mogwai's full-sized avatar

Harry Coultas Blum mogwai

View GitHub Profile
@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"
04e96779565af584ce2e9860d36dcb9ba94e63ab97d2bf6a5bee3b610ad1274a2da51d5c279ad66b34c0048dd86abc5847fae708ec8a46da3f49b427feefb2d1ab;MclloydVuong
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();
@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); }
<?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 / 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) {
}
}