Skip to content

Instantly share code, notes, and snippets.

View mtzaldo's full-sized avatar

Aldo Martinez mtzaldo

  • San Antonio, TX
View GitHub Profile
@mtzaldo
mtzaldo / JsonPatchDocumentHelper.cs
Last active July 26, 2019 18:53
Convert a plain object to JsonPatchDocument<T> (including Dictionary)
using Marvin.JsonPatch;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Linq;
using Marvin.JsonPatch.Operations;
namespace MyProject.ModelsExtensions
{
@mtzaldo
mtzaldo / crypto.cs
Created June 22, 2017 18:08 — forked from zachbonham/crypto.cs
RSA public key encryption in C#
using System;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
namespace Crtypto
{
class Program
{
static void Main(string[] args)
@mtzaldo
mtzaldo / Add more resolution display Ubuntu
Last active April 27, 2017 02:28 — forked from vutranvn/Add more resolution display Ubuntu
Add more resolution display Ubuntu
Add more resolution display
- Find out the name of your video device
sudo xrandr -q
Dell 2016H
cvt 1600 900 60
sudo xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
sudo xrandr --addmode eDP-1 1600x900_60.00
Dell S2340L
@mtzaldo
mtzaldo / chsarp.txt
Last active June 24, 2023 07:57
C# map / reduce / filter
Map = Select | Enumerable.Range(1, 10).Select(x => x + 2);
Reduce = Aggregate | Enumerable.Range(1, 10).Aggregate(0, (acc, x) => acc + x);
Filter = Where | Enumerable.Range(1, 10).Where(x => x % 2 == 0);
source: http://stackoverflow.com/a/13895253
Disable "Turn on Fast Startup". Right click the Start Button and select Power Options → System Settings. [1]
Disable "Automatic Restart".System Properties (right click on the start button and select System). Go to the Advanced tab and select Startup and Recovery Settings [2]
[1] http://dellwindowsreinstallationguide.com/2015/10/31/windows-10-not-shutting-down/
[2] http://www.tenforums.com/general-support/52170-laptop-refuses-shut-off.html
### NodeJS >=4
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node # if node command is unavail
node -v # check if you have the correct version v5.x.x
sudo npm install -g react-native-cli
### Java
sudo apt-get install lib32stdc++6 lib32z1 openjdk-7-jdk