Skip to content

Instantly share code, notes, and snippets.

View juliofruta's full-sized avatar
💭
🧠

Julio Fruta juliofruta

💭
🧠
View GitHub Profile
@juliofruta
juliofruta / example.swift
Last active August 8, 2016 22:54
A gist for examples
let tableViewA = UITableViewController()
let tableViewB = UITableViewController()
let viewController = UIViewController()
viewController.addChildViewController(tableViewA)
viewController.addChildViewController(tableViewB)
tableViewA.view.frame = CGRect(x: 0.0, y: 0.0, width: 300, height: 250)
tableViewB.view.frame = CGRect(x: 0.0, y: 250.0 , width: 300, height: 250)
viewController.view.frame = CGRect(x: 0.0, y: 0.0, width: 300, height: 500)
@juliofruta
juliofruta / button.swift
Last active August 8, 2016 22:58
Avoid button targets in Swift 2.2
class Button : UIButton {
private var _action : (()->())?
var action : ()->() {
get {
return _action!
}
set (newAction) {
_action = newAction
self.addTarget(self,
action: #selector(Button.actionCaller),
@juliofruta
juliofruta / mergegenstrings.py
Created January 25, 2017 17:44 — forked from yoichitgy/mergegenstrings.py
A script to generate .strings file for .swift, .m, .storyboard and .xib files by genstrings and ibtool commands, and merge them with existing translations.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Localize.py - Incremental localization on XCode projects
# João Moreno 2009
# http://joaomoreno.com/
# Modified by Steve Streeting 2010 http://www.stevestreeting.com
# Changes
# - Use .strings files encoded as UTF-8
@juliofruta
juliofruta / UnfoldSequenceExtension.swift
Last active April 16, 2017 18:58
UnfoldSequence to [UnfoldSequence.Iterator.Element]
extension UnfoldSequence {
func toArray(filter : (UnfoldSequence.Iterator.Element) -> (Bool) ) -> [UnfoldSequence.Iterator.Element] {
var arreglo = Array<UnfoldSequence.Iterator.Element>()
for value in self {
if !filter(value) { break }
arreglo.append(value)
}
return arreglo
}
}
@juliofruta
juliofruta / AVURLAssetLoading.m
Created June 12, 2017 21:35
How to reproduce assets at the same time
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:url options:nil];
NSArray *keys = [NSArray arrayWithObject:@"playable"];
//Carga los assets
[asset loadValuesAsynchronouslyForKeys:keys completionHandler:^()
{
//Al terminar reproducelos en la cola principal
dispatch_async(dispatch_get_main_queue(), ^
{
AVPlayerItem *playerItem = [[[AVPlayerItem alloc] initWithAsset:asset] autorelease];
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
Git Tips & Tricks - GitHub Satellite 2017: https://www.youtube.com/watch?v=moDdhDxzg2k
@juliofruta
juliofruta / gist:9bf873d358bdf77f27be63dd1472c614
Created October 20, 2017 16:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@juliofruta
juliofruta / lilbit.swift
Last active April 25, 2018 22:37
bitso challenge on facebook
let currentCollation = UILocalizedIndexedCollation.current().sectionTitles
for i in currentCollation.enumerated() {
if i.element == "G" {
print(i.offset + 1, i.element)
}
if i.element == "N" {
print(i.offset + 1, i.element)
}
if i.element == "T" {
print(i.offset + 1, i.element)
@juliofruta
juliofruta / Risk management macro.vs
Created May 5, 2018 18:01
A macro that helps you build repeated lists of fields
Sub Macro()
'
' Macro Macro
' Para usar: 1. Cambia el nombre de la página a Input. 2. Selecciona las filas que quieres transformar. 3. Selecciona los campos que quieres mostrar
'
' Acceso directo: CTRL+m
Dim filasATransformar As Range
Set filasATransformar = Application.InputBox("Selecciona un rango de filas a transformar", Type:=8)
Dim columnasAUtilizar As Range