Skip to content

Instantly share code, notes, and snippets.

View arlm's full-sized avatar

Alexandre Rocha Lima e Marcondes arlm

View GitHub Profile
@arlm
arlm / ErrorHandling.cs
Created September 14, 2020 17:27
ErrorHandling
using System;
public static class ErrorHandling
{
public static void HandleErrorByThrowingException() =>
throw new Exception("You need to implement this function.");
public static int? HandleErrorByReturningNullableType(string input) =>
int.TryParse(input, out int result) ? result : (int?)null;
@arlm
arlm / Queue.cs
Last active September 11, 2020 17:18
LinkedList + Stack + Queue
using System;
using System.Collections.Generic;
public class QueueDeque<T>
{
public void Enqueue(T value)
{
throw new NotImplementedException("You need to implement this function.");
}
@arlm
arlm / Clock+IComparer.cs
Last active September 11, 2020 17:51
Clock
using System;
using System.Diagnostics.CodeAnalysis;
public partial class Clock : IComparable, IComparable<Clock>,
IComparable<int>, IComparable<long>, IComparable<short>,
IComparable<decimal>, IComparable<double>, IComparable<float>
{
public int CompareTo(object other)
{
if (ReferenceEquals(this, other))
@arlm
arlm / BoolTest.cs
Created June 12, 2019 14:21
Bool Convert (IL Conv_I1) bug
using System;
using System.Reflection.Emit;
namespace BoolConvertBug
{
public class Program
{
public static void Main(string[] args)
{
Func<int, bool> func = CreateDynamicMethod();
@arlm
arlm / GORILLA.BAS
Created September 5, 2018 13:49 — forked from caffo/GORILLA.BAS
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana
@arlm
arlm / makeNES
Created July 6, 2018 20:56 — forked from openback/makeNES
Bash script to compile and assemble an NES ROM using loopy's asm6 and create files appropriate for burning to chips
#!/bin/bash
#===============================================================================
#
# FILE: makeNES
#
# USAGE: ./makeNES [options] [ASM [CHR [NES]]]
#
# DESCRIPTION: Bash script to compile and assemble an NES ROM using loopy's
# asm6 and create files appropriate for burning to chips
#
@arlm
arlm / vd_pause.xml
Created May 18, 2018 14:01 — forked from alexjlockwood/vd_pause.xml
VectorDrawable definitions for play, pause, and record icons with additional group transformations
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportHeight="12"
android:viewportWidth="12">
<!-- Rotate the canvas, then translate, then scale, then draw the pause icon. -->
<group android:scaleX="1.5" android:pivotX="6" android:pivotY="6">
<group
@arlm
arlm / gh-pages.md
Created May 15, 2018 12:04 — forked from ramnathv/gh-pages.md
Creating a clean gh-pages branch

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" &gt; index.html
@arlm
arlm / AdbCommands.md
Last active April 17, 2022 21:33 — forked from Pulimet/AdbCommands
Adb useful commands list

General ADB Commands

ADB Server

  • Ensures that there is an ADB server running: adb start-server
  • Kills the ADB server if it is running: adb kill-server

Device Rebooting

@arlm
arlm / android-screen-to-gif.sh
Created March 19, 2018 16:08 — forked from lorenzos/android-screen-to-gif.sh
Captures screen from Android device via ADB and makes a 180x320 GIF
#!/bin/bash
# How to install:
# exo-open "http://developer.android.com/sdk/index.html#Other"
# sudo apt-get install libav-tools imagemagick
# wget https://gist.githubusercontent.com/lorenzos/e8a97c1992cddf9c1142/raw/android-screen-to-gif.sh
# chmod a+x android-screen-to-gif.sh
# Help message
function usage() {