Skip to content

Instantly share code, notes, and snippets.

View franciscojunior's full-sized avatar

Francisco Figueiredo Jr. franciscojunior

View GitHub Profile
@franciscojunior
franciscojunior / App.config
Last active August 29, 2015 13:56
EF sample for #160 - Returning DB generated values on insert for EF fixing #159
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
@franciscojunior
franciscojunior / NpgsqlTests.dll-results.log
Last active December 12, 2015 03:58
Nunit tests result
Tests run: 620, Failures: 44, Not run: 0, Time: 10.338 seconds
Failures:
1) NpgsqlTests.CommandTests.FunctionCallStringEscape :
expected: <0>
but was: <1>
at NpgsqlTests.CommandTests.FunctionCallStringEscape () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
@franciscojunior
franciscojunior / NpgsqlConnectorPool.cs
Created March 14, 2013 16:30
This is a little hack to add more information about connection pool timeout problems. This change makes Npgsql logs the stacktrace of the allocation of all the connections which are present in the pool whenever there is a timeout when trying to get a connection from the pool. This helps to diagnose where the connection has been allocated.
// Copyright (C) 2002 The Npgsql Development Team
// npgsql-general@gborg.postgresql.org
// http://gborg.postgresql.org/project/npgsql/projdisplay.php
//
// Permission to use, copy, modify, and distribute this software and its
// documentation for any purpose, without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
// and this paragraph and the following two paragraphs appear in all copies.
//
// IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY
@franciscojunior
franciscojunior / Program.cs
Last active December 19, 2015 08:59
Npgsql SSL Test program
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Npgsql;
using Mono.Security.Protocol.Tls;
using Mono.Security.Authenticode;
namespace my
{
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[1~": beginning-of-line
"\e[4~": end-of-line
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="match_parent"
@franciscojunior
franciscojunior / exception.txt
Created June 9, 2016 22:03
Exception when trying to add a new dictionary entry on my cell phone
Process: com.android.settings, PID: 23842
java.lang.ClassCastException: com.android.settings.SubSettings cannot be cast to com.android.settings.SettingsActivity
at com.android.settings.UserDictionarySettings.showAddOrEditDialog(UserDictionarySettings.java:195)
at com.android.settings.UserDictionarySettings.onOptionsItemSelected(UserDictionarySettings.java:176)
at android.app.Fragment.performOptionsItemSelected(Fragment.java:2250)
at android.app.FragmentManagerImpl.dispatchOptionsItemSelected(FragmentManager.java:2003)
at android.app.Activity.onMenuItemSelected(Activity.java:3027)
at com.android.internal.policy.impl.PhoneWindow.onMenuIt
@franciscojunior
franciscojunior / PauseFirefoxSwitchWithPid.applescript
Created July 3, 2016 22:58
Apple Script to prevent firefox from running while it is without focus
# Reference http://stackoverflow.com/questions/7741879/if-i-wanted-to-modify-task-switching-in-osx
# Reference http://apple.stackexchange.com/questions/36163/applescript-kill-command-error
# http://lists.apple.com/archives/applescript-users/2012/Nov/msg00070.html
# SIGCONT and SIGSTOP don't work in shell executed by applescript.
# Has to use numbers, or STOP/CONT w/o SIG or use "set +o posix"
# http://unixhelp.ed.ac.uk/CGI/man-cgi?signal+7
# http://superuser.com/questions/14762/execute-applescript-without-open-the-editor
# http://stackoverflow.com/questions/13653358/how-to-log-objects-to-a-console-with-applescript
# http://lists.apple.com/archives/applescript-users/2013/Apr/msg00024.html
# http://en.wikipedia.org/wiki/AppleScript -- for on quit handler
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="30dp"
android:fromDegrees="45"
android:toDegrees="45">
<solid android:color="#00aadd"/>
<corners
android:radius="2dp"