Skip to content

Instantly share code, notes, and snippets.

View ajpinedam's full-sized avatar

Andres Pineda ajpinedam

View GitHub Profile
import os
import smtplib
import ssl
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@jonfhancock
jonfhancock / KotlinShared.xml
Last active December 10, 2020 01:35
Android Studio live templates. Apply them following directions here: https://www.jetbrains.com/help/idea/sharing-live-templates.html
<templateSet group="KotlinShared">
<template name="krequire" value="requireNotNull($VAR$) {&#10; &quot;Required value '$VAR$' in $CLASS_NAME$.$FUNCTION_NAME$() was null.&quot;&#10;}&#10;$END$" description="Require Not Null with a helpful print statement" toReformat="true" toShortenFQNames="true">
<variable name="VAR" expression="kotlinVariable()" defaultValue="" alwaysStopAt="true" />
<variable name="CLASS_NAME" expression="kotlinClassName()" defaultValue="" alwaysStopAt="false" />
<variable name="FUNCTION_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<context>
<option name="KOTLIN" value="true" />
</context>
</template>
</templateSet>
@ajumalp
ajumalp / Install Mosquitto MQTT on Synology NAS Server.txt
Last active June 26, 2024 02:51
Install Mosquitto MQTT on Synology NAS Server
From https://synocommunity.com add http://packages.synocommunity.com to your NAS package sources.
For that, go to NAS->Package Cnter->Click Settings->Package Sources tab.
Then from the community, you can see Mosquitto. Install it.
After installing, please stop the Mosquitto service before updating configuration. You can start service after changes.
Enable Admin login for Synology
Enable SSH in NAS
Download putty and connect to NAS Server
Login using admin
Change to root user [sudo -i, {use admin password}]
Find mosquitto.conf file [find / -name mosquitto.conf]
@cecilemuller
cecilemuller / launch.json
Last active June 22, 2024 13:33
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
anonymous
anonymous / customadaptador.cs
Created June 14, 2017 02:28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
@veryhumble
veryhumble / RecyclerViewAdapter.cs
Last active August 5, 2021 19:13
Xamarin.Forms RecyclerView Renderer for Android
using System.Collections;
using System.Diagnostics;
using A11YGuide.Controls;
using A11YGuide.Droid.Helpers;
using A11YGuide.ViewModels.Search;
using Android.Support.V7.Widget;
using Android.Views;
using Android.Widget;
using fivenine.Core.Extensions;
using Xamarin.Forms;
@insidegui
insidegui / WebCacheCleaner.swift
Created September 14, 2016 23:12
Clear WKWebView's cookies and website data storage, very useful during development.
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
@define-private-public
define-private-public / HttpServer.cs
Last active June 28, 2024 13:57
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active July 4, 2024 09:54
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:

@NVentimiglia
NVentimiglia / ItemStack.cs
Last active October 31, 2021 21:06
Need a Items control or a repeater for Xamarin ? Here you go. Bind to observable collections, define your data template and enjoy.
// MIT License
// Nicholas Ventimiglia
// 2016-9-19
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;