Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓
Learning

Johnny Santos johnnyasantoss

🤓
Learning
View GitHub Profile
@johnnyasantoss
johnnyasantoss / DbusNotification.cs
Last active Aug 21, 2019
C# Desktop Notifications on Linux
View DbusNotification.cs
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Tmds.DBus;
[assembly: InternalsVisibleTo(Connection.DynamicAssemblyName)]
namespace dbus_test
{
/// <seealso>http://www.galago-project.org/specs/notification/0.9/x408.html</seealso>
@johnnyasantoss
johnnyasantoss / Exception.log
Created Aug 13, 2019
Reproduction of a bug when trying to write
View Exception.log
Unhandled Exception: ImageMagick.MagickDrawErrorException: NonconformingDrawingPrimitiveDefinition `text' @ error/draw.c/RenderMVGContent/4398
at ImageMagick.MagickExceptionHelper.Check(IntPtr exception)
at ImageMagick.DrawingWand.NativeDrawingWand.Render()
at ImageMagick.MagickImage.Draw(IEnumerable`1 drawables)
at ImageMagick.Drawables.Draw(IMagickImage image)
at temp_test.Program.Main(String[] args) in /tmp/temp-test/Program.cs:line 29
@johnnyasantoss
johnnyasantoss / README.md
Last active Aug 27, 2022
Adding .NET related mime types to Linux
View README.md

Copy this xml to ...

sudo $EDITOR /usr/share/mime/packages/dotnet.xml

Contents:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="application/x-dotnet-solution">
	  <comment>.NET Solution</comment>
	  <sub-class-of type="text/plain"/>
@johnnyasantoss
johnnyasantoss / my-awesome-gnome-extensions.txt
Last active Mar 11, 2020
A list of my awesome gnome extensions!! (separated with tabs for easy scripting)
View my-awesome-gnome-extensions.txt
Github Notifications https://extensions.gnome.org/extension/1125/github-notifications/
Gravatar https://extensions.gnome.org/extension/1015/gravatar/
Sound Input & Output Device Chooser https://extensions.gnome.org/extension/906/sound-output-device-chooser/
Remove Dropdown Arrows https://extensions.gnome.org/extension/800/remove-dropdown-arrows/
Status Area Horizontal Spacing https://extensions.gnome.org/extension/355/status-area-horizontal-spacing/
Extension Update Notifier https://extensions.gnome.org/extension/1166/extension-update-notifier/
User Themes https://extensions.gnome.org/extension/19/user-themes/
Removable Drive Menu https://extensions.gnome.org/extension/7/removable-drive-menu/
Places Status Indicator https://extensions.gnome.org/extension/8/places-status-indicator/
AlternateTab https://extensions.gnome.org/extension/15/alternatetab/
@johnnyasantoss
johnnyasantoss / .gitconfig
Last active Aug 9, 2022
JetBrains Rider as Default Merge and Diff tool
View .gitconfig
# Diff with JetBrains Rider
[diff]
tool = rider
[difftool]
prompt = false
[difftool "rider"]
cmd = D:\\\\Program\\ Files\\\\Jetbrains\\\\apps\\\\Rider\\\\ch-0\\\\181.4379.788\\\\bin\\\\rider64.exe diff "$LOCAL" "$REMOTE"
# Merge with JetBrains Rider
[merge]
@johnnyasantoss
johnnyasantoss / mono-fedora-install.sh
Last active Oct 16, 2017
Installs mono (5.2.0.224) on Fedora.
View mono-fedora-install.sh
#!/usr/bin/bash
VERSION=5.2.0.224
curl -OL https://download.mono-project.com/sources/mono/mono-$VERSION.tar.bz2
PREFIX=/usr/local
tar xvf mono-$VERSION.tar.bz2
cd mono-$VERSION
./configure --prefix=$PREFIX
@johnnyasantoss
johnnyasantoss / publish.cake
Created Mar 17, 2017
Deploy usando cake build
View publish.cake
#addin "Cake.IIS"
#addin "Cake.Http"
#addin "Cake.Services"
using System;
string servidor = null;
var servidores = Argument<string>("AppServers", string.Empty).Split(',');
var appPoolOrService = Argument<string>("AppPoolOrService", string.Empty);
@johnnyasantoss
johnnyasantoss / TesteBoletoPV.php
Last active Mar 8, 2017
Um exemplo de como fazer uma chamada na API V4 de Boletos da PagueVeloz.
View TesteBoletoPV.php
<?php
//dados necessários para fazer qualquer requisição
$email = 'emaildoclientepv@teste.com.br';
$token = '0000-1234-4321-5678-9876';
$dominio = 'https://sandbox.pagueveloz.com.br';
//cria o token de segurança para fazer a chamada na API
$authToken = base64_encode($email . ':' . $token);
@johnnyasantoss
johnnyasantoss / TesteBoletoPV.cs
Last active Mar 6, 2017
Um exemplo de uma chamada na API do PagueVeloz
View TesteBoletoPV.cs
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Text;
namespace Teste.PV
{
public class Teste
{
public static void Main(string[] args)
@johnnyasantoss
johnnyasantoss / debug-ui-view.js
Created Feb 9, 2017
Use this script to debug ui-view (works with minified files too!) Just paste it on console and hit enter.
View debug-ui-view.js
jQuery(function ($) {
var view = $("[ui-view]").first();
if (!view) return;
var $rootScope = angular.element(view).injector().get('$rootScope');
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
console.log('$stateChangeStart to ' + toState.name + '- fired when the transition begins. toState,toParams : \n', toState, toParams);
});