Skip to content

Instantly share code, notes, and snippets.

View ajpinedam's full-sized avatar

Andres Pineda ajpinedam

View GitHub Profile
@ajpinedam
ajpinedam / LinqReplace
Created January 8, 2014 17:15
Using replace on a Linq Lambda Expression..
void Main()
{
var indi = new List<Indi>();
var cedulaSearch = "02317270340";
indi.Add(new Indi{Name="Joseph", Cedula="013-1487034-8"});
indi.Add(new Indi{Name="Milton", Cedula="023-1727034-0"});
var result = indi.FirstOrDefault(u => u.Cedula.Replace("-","") == cedulaSearch);
Megsoft Consulting - Xamarin Mobile Developer.
===============================
Hello dude,
We are currently expanding, and are looking to bring on another compadre (or comadre) to [Megsoft Consulting Inc](http://www.megsoftconsulting.com). We're a company that has been profitable since day 0; we had an amazing year and continue to grow on a steady pace.
Our quest searching for a passionate and savvy Mobile developer has just begun.
@ajpinedam
ajpinedam / gist:c53af0e335f6a2762516
Created July 14, 2014 14:57
Create TableLayout Android
public void insertRealDataToTable(List<Person> people)
{
float scale = getResources().getDisplayMetrics().density;
int leftPad = (int) (getResources().getDimension(R.dimen.tbl_row_left_pad)*scale + 0.5f);
int topPad = (int) (getResources().getDimension(R.dimen.tbl_row_top_pad)*scale + 0.5f);
int rightPad = (int) (getResources().getDimension(R.dimen.tbl_row_right_pad)*scale + 0.5f);
int bottomPad = (int) (getResources().getDimension(R.dimen.tbl_row_bottom_pad)*scale + 0.5f);
using System;
using System.Collections.Generic;
namespace PrintList
{
public class Program
{
static void Main(string[] args)
{
PrintList("Mono", new List<object>
@ajpinedam
ajpinedam / gist:57f52532b17498c53b1d
Last active August 29, 2015 14:04
BanDay C# Script
using (var db = _devDoContextFactory.Create())
{
var userExceptions = {"pinedax", "Melvyn Perez"};
var roleExceptions = {"Admins", "Dioxes"};
var defaultSearch = {"dembow"};
//......
//......
//......
//......
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Xamarin.Forms;
using Parse;
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Edit(EditFooVm vm)
{
if (!ModelState.IsValid)
{
SaveModelState();
return RedirectToAction("Edit", new {id = vm.FooId});
}
@ajpinedam
ajpinedam / gist:1b2c2abcda0f935f17d5
Created March 11, 2015 18:10
Xamarin CMFormatDescription exception - {Xamarin.IOS 8.8.0.2}
2015-03-03 12:58:50.725 ScAppiOS[157:3266] critical: at <unknown> <0xffffffff>
2015-03-03 12:58:50.726 ScAppiOS[157:3266] critical: at (wrapper managed-to-native) MonoTouch.CoreFoundation.CFObject.CFRelease (intptr) <0xffffffff>
2015-03-03 12:58:50.727 ScAppiOS[157:3266] critical: at MonoTouch.CoreMedia.CMFormatDescription.Dispose (bool) [0x00015] in /Developer/MonoTouch/Source/maccore/src/CoreMedia/CMFormatDescription.cs:74
2015-03-03 12:58:50.728 ScAppiOS[157:3266] critical: at MonoTouch.CoreMedia.CMFormatDescription.Finalize () [0x00000] in /Developer/MonoTouch/Source/maccore/src/CoreMedia/CMFormatDescription.cs:58
2015-03-03 12:58:50.729 ScAppiOS[157:3266] critical: at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) <0xffffffff>
2015-03-03 12:58:50.730 ScAppiOS[157:3266] critical:
Native stacktrace:
Thread started: #17
2015-03-03 12:58:51.593 ScAppiOS[157:3266] critical: 0 ScAppiOS 0x03367b25 mono_handle_native_
Pythondotorg at Montreal-Python Project Night
=============================================
The idea is to work on a Django project and to help the Python community by
making the Python website better.
For Installation instructions, please have a look at the following document:
http://htmlpreview.github.io/?https://github.com/mtlpy/pythondotorgdocs/blob/master/build/html/index.html
<?xml version="1.0" encoding="UTF-8"?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Xamarin.Forms.Controls.MacTwitterDemo">
<MasterDetailPage.Master>
<ContentPage BackgroundColor="#24456e" Title="Master">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<ScrollView Margin="0,55,0,0" BackgroundColor="Transparent">