Skip to content

Instantly share code, notes, and snippets.

View phynet's full-sized avatar
🤘
I said yeah.

Sofia Swidarowicz phynet

🤘
I said yeah.
View GitHub Profile
@phynet
phynet / Copy-Paste text from desktop clipboard to android textfield.mkd
Last active December 7, 2016 08:16
Copy/Paste text from MacOS desktop clipboard to any field (except url field browser) in android emulator
~/Library/Android/sdk/platform-tools/adb shell input text 'this is a text'
@phynet
phynet / delete-branch-delete-DSStore.md
Last active March 28, 2017 10:50
Alias to delete a remote branch and to delete .DS_Store files from our repo

Bash profile file:

alias git-rmDS="find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch"

alias git-rmb='function _delete_branch(){ echo "Deleting branch: $1"; git push origin --delete "$1"; };_delete_branch'

Use with Command Line as:

  1. Delete a remote branch
@phynet
phynet / delete-tag-remote-repo.md
Created August 2, 2016 08:42
Delete tag from remote repo
git tag -d release01

git push origin :refs/tags/release01

@phynet
phynet / Add-Image-to-UILabel-or-NSString.m
Last active January 11, 2017 09:11
Add a image to a UILabel
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
attachment.image = [UIImage imageNamed:@"image.png"];
//add image to the right side of the text
attachment.bounds = CGRectMake(10, -4, 28,28);
//add image to the left side of the text
attachment.bounds = CGRectMake(-4, 0, 18,18);
NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:attachment];
NSMutableAttributedString *stringWithIcon= [[NSMutableAttributedString alloc] initWithString:@""];
@phynet
phynet / template-UItableView-Swift.md
Last active November 14, 2023 12:43
Template to create a simple UITableView in a UIViewController
  1. Add UItableView inside ViewController in Storyboard.
  2. Create IBOutlet called tableView
  3. Set Delegate and DataSource in ViewController in Storyboard
class ViewControllerCustom: UIViewController, UITableViewDelegate, UITableViewDataSource {
    
     var items: [String] = ["Swift1", "Swift2", "Swift3"]
@phynet
phynet / git-commit-amend.mkd
Created July 5, 2016 14:33
Rewrite message in remote commit
git commit --amend

git push --force-with-lease

@phynet
phynet / Dev-config.md
Last active August 4, 2016 09:49
My Config for iOS developing

##Tools I'm using to develop

###Code Editors

  • Atom for Node and JS
  • Sublime for Ruby, Node, JS
  • Text Wrangler everything else

iOS Editor

@phynet
phynet / dictionary-with-dynamic-keys.js
Last active July 18, 2016 19:23
How to create dynamic keys in JS...order by same keys
/*
Entry:
[ { key: 'activar_reserva_email',
ES: 'Email que usarás en la aplicación ',
EN: 'The email address you will use on the application' },
{ key: 'activar_reserva_cuenta_no_registrado',
ES: 'La cuenta donde quieres recibir los pagos',
EN: 'The account where you wish to receive your payments' },
{ key: 'activar_reserva_boton_no_registrado',
@phynet
phynet / image-right-side-button.m
Created May 26, 2016 11:44
Switch image to the right side of the button - iOS
//Switch image to the right side of the button
self.mapButton.transform = CGAffineTransformMakeScale(-1.0, 1.0);
self.mapButton.titleLabel.transform = CGAffineTransformMakeScale(-1.0, 1.0);
self.mapButton.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);