Skip to content

Instantly share code, notes, and snippets.

View johnnyasantoss's full-sized avatar
🤓
Learning

Johnny Santos johnnyasantoss

🤓
Learning
View GitHub Profile
@johnnyasantoss
johnnyasantoss / debug-ui-view.js
Created February 9, 2017 11:50
Use this script to debug ui-view (works with minified files too!) Just paste it on console and hit enter.
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);
});
@johnnyasantoss
johnnyasantoss / TesteBoletoPV.cs
Last active March 6, 2017 21:43
Um exemplo de uma chamada na API do PagueVeloz
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 / TesteBoletoPV.php
Last active March 8, 2017 18:35
Um exemplo de como fazer uma chamada na API V4 de Boletos da PagueVeloz.
<?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 / publish.cake
Created March 17, 2017 21:02
Deploy usando cake build
#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 / mono-fedora-install.sh
Last active October 16, 2017 23:43
Installs mono (5.2.0.224) on Fedora.
#!/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 / .gitconfig
Last active May 13, 2024 16:58
JetBrains Rider as Default Merge and Diff tool
# 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 / my-awesome-gnome-extensions.txt
Last active March 11, 2020 12:58
A list of my awesome gnome extensions!! (separated with tabs for easy scripting)
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 / README.md
Last active September 23, 2024 22:45
Adding .NET related mime types to Linux

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 / Exception.log
Created August 13, 2019 11:00
Reproduction of a bug when trying to write
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 / DbusNotification.cs
Last active September 15, 2023 18:11
C# Desktop Notifications on Linux
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>