Skip to content

Instantly share code, notes, and snippets.

View ElyDantas's full-sized avatar
🏠
Working from home

Ely Dantas ElyDantas

🏠
Working from home
View GitHub Profile
@ElyDantas
ElyDantas / AutoRezingUiTableView.txt
Last active August 19, 2024 01:16
Resizing UITableView to fit Content Swift
StackOverflow answer by fl034 user.
Link: https://stackoverflow.com/questions/2595118/resizing-uitableview-to-fit-content/48623673#48623673
Swift 4.2 solution without KVO, DispatchQueue, or setting constraints yourself.
This solution is based on Gulz's answer.
1) Create a subclass of UITableView:
import UIKit
Swift App-Prefs:root-path
Swift
UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General")!)
Swift 3
UIApplication.shared.openURL(URL(string:"App-Prefs:root=General")!)
Objective-c
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General"]];
and following are all the available urls
ANDROID STUDIO + WIFI
// Connect device
cd Library/Android/sdk/platform-tools/
./adb tcpip 5555
./adb connect 192.168.0.12
Back to USB mode
./adb -s 192.168.0.12 usb
@ElyDantas
ElyDantas / LiquidCarbon.terminal
Created November 8, 2018 20:41
Liquid Carbon - Mac Terminal Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw
IDAAEAKAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa
@ElyDantas
ElyDantas / Extensions.swift
Last active September 25, 2018 18:30
My daily incremental for extension class
//
// Extensions.swift
//
// Created by Ely Dantas on 10/09/2087.
// Copyright © 2018 Ely. All rights reserved.
//
import Foundation
import UIKit
@ElyDantas
ElyDantas / CyberPunk.xccolortheme
Last active September 25, 2018 05:38
Xcode theme created by me :)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.972549 0.972549 0.94902 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Regular - 13.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.972549 0.972549 0.94902 1</string>
@ElyDantas
ElyDantas / FlashLightBlinkerFragment.java
Created September 14, 2017 00:49
Example of code to turn on/off a android flashlight in a particular sequence and speed
package esmaltec.etalk;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ElyDantas
ElyDantas / ImagePicker.java
Created October 2, 2015 14:35 — forked from Mariovc/ ImagePicker.java
Utility for picking an image from Gallery/Camera with Android Intents
/**
* Author: Mario Velasco Casquero
* Date: 08/09/2015
* Email: [email protected]
*/
public class ImagePicker {
private static final int DEFAULT_MIN_WIDTH_QUALITY = 400; // min pixels
private static final String TAG = "ImagePicker";
@ElyDantas
ElyDantas / ParallaxPageTransformer.java
Last active September 18, 2015 12:23 — forked from Aracem/ParallaxPageTransformer.java
Parallax transformer for ViewPagers that let you set different parallax effects for each view in your Fragments.
package com.aracem.utils.animations.pagetransformation;
import org.jetbrains.annotations.NotNull;
import android.support.v4.view.ViewPager;
import android.view.View;
import java.util.ArrayList;
import java.util.List;