Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar
🎏
On the wind

Hector De Diego hectorddmx

🎏
On the wind
View GitHub Profile
@hectorddmx
hectorddmx / format_date_with_offset_test.dart
Last active September 21, 2023 03:48 — forked from j0nscalet/format_date_with_offset_test.dart
Forked to manually support Z
import 'package:test/test.dart';
import 'package:intl/intl.dart';
import 'package:timezone/timezone.dart';
import 'package:timezone/data/latest.dart';
// A DateTime in dart contains the TimezoneOffset from UTC/GMT
// This was modified to ommit the `:` so we actually have implemented the Z
// Timezone formatter in dart.
//
// See: https://github.com/dart-lang/intl/issues/19 for more details.
#import "ViewController.h"
#import <CoreImage/CoreImage.h>
#import <AVFoundation/AVFoundation.h>
@interface ViewController () {
}
@property (strong, nonatomic) CIContext *coreImageContext;
@property (strong, nonatomic) AVCaptureSession *cameraSession;
@hectorddmx
hectorddmx / Disable iOS Simulator Incoming Connections Popup.sh
Created September 9, 2020 16:15 — forked from TomSoderling/Disable iOS Simulator Incoming Connections Popup.sh
Bash script for turning off the iOS simulator pop-up message
#!/bin/bash
# Script to disable the iOS Simulator app from showing the "Do you want the application xxxx to accept incoming network connections?" pop-up every time the app is run
echo "> Enter password to temporarily shut firewall off"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
echo "> Add Xcode as a firewall exception"
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/MacOS/Xcode
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@hectorddmx
hectorddmx / README.md
Last active September 14, 2018 19:23 — forked from guilhermearaujo/README.md
OCLint integration with Xcode

OCLint (0.13) integration with Xcode

1. Integration

  • Add a new Target of kind Aggregate, name it OCLint
  • Under Builde Phases, add a new Run Script Phase
  • Paste the script

2. Usage

  • Select target OCLint
  • Build the target (press ⌘+B)
@hectorddmx
hectorddmx / UIColorExtension.md
Created May 7, 2018 01:55 — forked from bhrott/UIColorExtension.md
Swift 3: Hex UIColor

Extension:

import Foundation
import UIKit

extension UIColor {
    convenience init(hexString: String) {
        let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
        var int = UInt32()
 Scanner(string: hex).scanHexInt32(&amp;int)
@hectorddmx
hectorddmx / Fonts.swift
Created April 23, 2018 04:58 — forked from feighter09/Fonts.swift
Set global font for iOS app in one place
// MARK: - Swizzling
extension UIFont {
class var defaultFontFamily: String { return "Georgia" }
override public class func initialize()
{
if self == UIFont.self {
swizzleSystemFont()
}
}
@hectorddmx
hectorddmx / install_pyenv.sh
Created April 8, 2018 23:43 — forked from ysaotome/install_pyenv.sh
pyenv install for CentOS 6.5 x86_64
#!/bin/zsh
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@hectorddmx
hectorddmx / run phoenix on amazon linux.sh
Last active March 9, 2018 05:43 — forked from eikes/run phoenix on amazon linux.sh
run phoenix on amazon linux
export LANG="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
cd /
# app deps
yum install git -y
# erlang deps
@hectorddmx
hectorddmx / Elixir Email Validation
Last active March 8, 2018 07:14 — forked from mgamini/Elixir Email Validation
Elixir Email Validation
defmodule EmailValidator do
# ensure that the email looks valid
def validate_email(email) when is_binary(email) do
case Regex.run(~r/^[A-Za-z0-9._%+-+']+@[A-Za-z0-9.-]+\.[A-Za-z]+$/, email) do
nil ->
{:error, "Invalid email"}
[email] ->
try do
Regex.run(~r/(\w+)@([\w.]+)/, email) |> validate_email