Skip to content

Instantly share code, notes, and snippets.

View Palisand's full-sized avatar

Panaos Alisandratos Palisand

  • RocketVisor Corporation
  • NYC
View GitHub Profile
@Palisand
Palisand / RCTTextSelection.m
Last active October 9, 2017 21:14
Changes for scroll-to-cursor functionality.
@implementation RCTTextSelection
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end cursorPosition:(CGPoint)cursorPosition
/* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
{
if (self = [super init]) {
_start = start;
_end = end;
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
@Palisand
Palisand / RCTTextSelect.h
Last active October 9, 2017 21:07
Changes for scroll-to-cursor functionality.
/**
* Object containing information about a TextInput's selection.
*/
@interface RCTTextSelection : NSObject
@property (nonatomic, assign, readonly) NSInteger start;
@property (nonatomic, assign, readonly) NSInteger end;
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
@property (nonatomic, assign, readonly) CGPoint cursorPosition;
@Palisand
Palisand / ReactTextInputSelectionEvent.java
Last active October 11, 2017 16:17
Changes for scroll-to-cursor functionality.
/**
* Event emitted by EditText native view when the text selection changes.
*/
/* package */ class ReactTextInputSelectionEvent
extends Event<ReactTextInputSelectionEvent> {
private static final String EVENT_NAME = "topSelectionChange";
private int mSelectionStart;
private int mSelectionEnd;
@Palisand
Palisand / ReactTextInputManager.java
Last active October 8, 2017 21:28
Changes for scroll-to-cursor functionality.
import android.text.Layout;
...
private class ReactSelectionWatcher implements SelectionWatcher {
private ReactEditText mReactEditText;
private EventDispatcher mEventDispatcher;
private int mPreviousSelectionStart;
private int mPreviousSelectionEnd;
@Palisand
Palisand / ct.py
Created February 16, 2017 22:58
Time Puncher
#!/usr/local/bin/python
import sys
import ast
import inspect
import keyring # for storing password in OS X Keychain
from datetime import datetime
from subprocess import check_output
from astunparse import unparse
from grab import Grab