Skip to content

Instantly share code, notes, and snippets.

View luiseduardohd's full-sized avatar
🎯
Focusing

Luis Hernandez luiseduardohd

🎯
Focusing
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace ColorControl {
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
@luiseduardohd
luiseduardohd / UIViewController Category for Screnshots
Created April 16, 2013 04:45
Drag&Drop solution, take screenshot of any UIViewController in app with categories and reflection. (subclass must call [super viewDidAppear:animated]; )
//
// AppDelegate.m
// ScreenshotFramework
//
// Created by Luis Eduardo Hernandez Diaz on 15/04/13.
// Copyright (c) 2013 Luis Eduardo Hernandez Diaz. All rights reserved.
//
#import "AppDelegate.h"
//#import "draw2D.h"
@luiseduardohd
luiseduardohd / MessageBox iOs
Created February 12, 2014 16:53
simple MessageBox para Xamarin ios
public static class MessageBox
{
public static void Show(string title, string message, MessageBoxButton buttons, Action positiveCallback, Action negativeCallback)
{
UIAlertView alert = BuildAlert(title, message, buttons);
alert.Clicked += (sender, buttonArgs) =>
{
if (buttonArgs.ButtonIndex == 0)
{
-- luaregex.lua ver.130911
-- A true, python-like regular expression for Lua
--
-- Usage:
-- local re = dofile("luaregex.lua")
-- local regex = re.compile("\\w+")
-- for match in regex:finditer("Hello, World!") do
-- print(match:group(0))
-- end
--
@luiseduardohd
luiseduardohd / fakeSleep.js
Created April 16, 2014 21:41
Try to sleep in javascript
var hasFinished = false
function sleep(millis) {
setTimeout(
function()
{
hasFinished = true;
console.log("hasFinished...");
}
,
millis
using System;
using MonoTouch.UIKit;
using MonoTouch.SceneKit;
using MonoTouch.Foundation;
namespace HelloSceneKit
{
public class HelloSceneKitController : UIViewController
{
SCNView sceneView;
//does the actual coloring
void DrawPoints (CGContext dctx)
{
dctx.BeginPath ();
dctx.MoveTo (Points.First().X, Points.First().Y);
dctx.SetLineWidth(swatchSlider.Value);
dctx.SetBlendMode (CGBlendMode.Normal);
foreach (var crayon in Crayons) {
/// <summary>
/// Processes a given directory, grouping and listing files with duplicate content
/// </summary>
/// <param name="directory">The path to process</param>
private void ListDuplicateFiles(string directory)
{
// Calculate and store the hash and path for each file in the directory
var files = Directory.GetFiles(directory).Select(f => new { Path = f, Hash = FileHash.CalculateFromFile(f) });
// Group and iterate when duplicates exist
# Doxyfile 1.8.7
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
public class HashEncryption
{
/// <summary>
/// Encrypts a string using the MD5 hash encryption algorithm.
/// Message Digest is 128-bit and is commonly used to verify data, by checking
/// the 'MD5 checksum' of the data. Information on MD5 can be found at:
///
/// http://www.faqs.org/rfcs/rfc1321.html
/// </summary>
/// <param name="Data">A string containing the data to encrypt.</param>