Skip to content

Instantly share code, notes, and snippets.

View yehorhromadskyi's full-sized avatar

Yehor yehorhromadskyi

View GitHub Profile
open -a Simulator
xcrun simctl uninstall booted <app_id>
(lldb)
e (void)[0x12345 setAlpha: 1.0]
e (void)[0x12345 setBackgroundColor: [UIColor redColor]]
e (void)[CATransaction flush]
po ((UIView *) 0x12345).layer
adb logcat | grep “”
using System;
using System.Threading.Tasks;
using UIKit;
namespace interview_questions_ios
{
public partial class ViewController : UIViewController
{
public ViewController(IntPtr handle) : base(handle)
{
using System;
using System.Text;
namespace types
{
public class ValRefTypes
{
public ValRefTypes()
{
var i = 10;
$ git log --graph --oneline --all
$ git stash save "my_stash"
$ git stash list
$ git stash pop stash@{n}
$ git stash apply stash@{n}
$ git commit -m "Title" -m "Description ..........";
$ git checkout [name_of_branch]
@yehorhromadskyi
yehorhromadskyi / Opacity
Last active February 8, 2019 13:10
List of opacity values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
@yehorhromadskyi
yehorhromadskyi / ImageReader.cs
Last active June 18, 2018 09:41
Read image resource as byte array
byte[] OpenImage()
{
byte[] imageData = null;
var assembly = GetType().GetTypeInfo().Assembly;
string filePath = "AssemblyName" + ".FolderName.FileName.extension";
using (Stream s = assembly.GetManifestResourceStream(filePath))
{
long length = s.Length;
imageData = new byte[length];
@yehorhromadskyi
yehorhromadskyi / ByteReader.cs
Created June 18, 2018 09:31
Android.Net.Uri to byte array
private byte[] ReadBytes(Android.Net.Uri uri)
{
var stream = ContentResolver.OpenInputStream(uri);
var byteArrayStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int i = Java.Lang.Integer.MaxValue;
while ((i = stream.Read(buffer, 0, buffer.Length)) > 0)
{
byteArrayStream.Write(buffer, 0, i);