Skip to content

Instantly share code, notes, and snippets.

View feliperomero3's full-sized avatar

Felipe Romero feliperomero3

View GitHub Profile
@feliperomero3
feliperomero3 / checkbox-misc.js
Last active February 8, 2024 06:07
jQuery snippets
var toCheck = $('input[type=checkbox]').filter('[value=' + rateCode + ']');
//$('input[type=checkbox]').filter('[value=1022]').attr('checked', true);
var toCheck3 = $('input[type=checkbox][value="' + rateCode + '"]');
$('input[type=checkbox][value="1024"]').attr('checked', true);
var toCheck2 = $(':checkbox[value=' + rateCodeP + ']');
//$(':checkbox[value='+rateCodeP+']').attr('checked', true);
@feliperomero3
feliperomero3 / sapCrystalReport.txt
Created September 1, 2015 20:19
How to read Crystal Report file Design version programmatically
Don Williams
Correct Answer
by Don Williams on Mar 14, 2011 3:16 PM
Hello,
You can't read the info from the file itself, proprietary format,
you have to load the report:
rpt.Load(rptName.ToString());
@feliperomero3
feliperomero3 / simple-php-form.php
Last active August 16, 2016 22:58
Simple PHP Form
<?php
// Original source: https://github.com/bootstrapbay/contact-form
// Original author: https://github.com/cgimmer
$errName = "";
$errEmail = "";
$errMessage = "";
$errHuman = "";
$result = "";
@feliperomero3
feliperomero3 / MsdnCodeExample.cs
Last active January 3, 2017 23:38
Microsoft .NET Framework INotifyPropertyChanged Interface.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
// Either change the following namespace to the name of your project,
// or name your project with the following name when you create it.
//
@feliperomero3
feliperomero3 / salty.vb
Last active October 21, 2016 14:21
How to use Enums in VB.Net
Imports System
Public Enum flavorEnum
salty
sweet
sour
bitter
End Enum
Public Module Module1
@feliperomero3
feliperomero3 / ReportHelper.vb
Created October 21, 2016 14:23
Helper class to load Crystal Report's report
Imports CrystalDecisions.CrystalReports.Engine
Imports SAPBusinessObjects.WPF.Viewer
Imports CrystalDecisions.Shared
Public Class ReportHelper
Private _pageTitle As String
Private _reportPage As Page
Private _reportViewer As CrystalReportsViewer
Private _reportFilePath As String
Private _report As ReportDocument
@feliperomero3
feliperomero3 / XmlDocsExample.cs
Last active August 10, 2017 23:08
How to use XML comments using C# on Visual Studio (Source: MSDN)
// https://msdn.microsoft.com/en-us/library/z04awywx.aspx
// If compiling from the command line, compile with: /doc:YourFileName.xml
/// <summary>
/// Class level summary documentation goes here.</summary>
/// <remarks>
/// Longer comments can be associated with a type or member through
/// the remarks tag.</remarks>
public class TestClass : TestInterface
{
@feliperomero3
feliperomero3 / BoolVisibilityConverter.vb
Last active May 26, 2017 21:47
Bool to Visibility converter for Windows Presentation Foundation
' Converts true to Visibility.Visible and false to Visibility.Hidden (can be changed to Visibility Collapsed)
Public Class BoolVisibilityConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
If Not targetType = GetType(Visibility) Then
Throw New Exception("The target must be Visibility type")
End If
Dim valueAux As Nullable(Of Boolean) = CBool(value)
@feliperomero3
feliperomero3 / ApplicationDbContextEntityValidationOverrides.cs
Last active February 13, 2022 03:16
Display all entity validation errors (EF 6)
public class ApplicationDbContext : DbContext
{
//...
public override int SaveChanges()
{
try
{
return base.SaveChanges();
}
@feliperomero3
feliperomero3 / CollectionExtension.cs
Created January 12, 2017 01:13
.NET Extensions for ICollection<T>
namespace AuditoriaIngresos.Helpers
{
using System;
using System.Collections.Generic;
using System.Linq;
public static class CollectionExtension
{
public static ICollection<T> AddRange<T>(this IEnumerable<T> list, ICollection<T> collection)
{