This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol NavigationBarTitleViewMixin { | |
func showAppLogoInTitleView() | |
} | |
extension NavigationBarTitleViewMixin where Self:UIViewController { | |
func showAppLogoInTitleView() { | |
let logoView = UIImageView(image: UIImage(named:"navbar_brand")) | |
self.navigationController!.navigationBar.setTitleVerticalPositionAdjustment(-6.0, forBarMetrics: .Default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let replaced = String(challengeName.characters.flatMap { | |
$0 == "#" ? nil : $0 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol TableViewFooter:class { | |
var footerActivityIndicator:UIActivityIndicatorView! {get set} | |
var tableView:UITableView! {get set} | |
func setupTableViewFooter() | |
} | |
extension TableViewFooter { | |
func setupTableViewFooter() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func scrollViewDidScroll(scrollView: UIScrollView) { | |
// when reaching bottom, load a new page | |
if scrollView.contentOffset.y == scrollView.contentSize.height - scrollView.bounds.size.height | |
{ | |
// fetch next page of results | |
//self.footerActivityIndicator.startAnimating() | |
self.dataPaginator.fetchNextBatch() | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The MIT License (MIT) | |
// | |
// Copyright (c) 2015 Isuru Nanayakkara | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Supermodel | |
## A Sega Model 3 Arcade Emulator. | |
## Copyright 2011-2016 Bart Trzynadlowski, Nik Henson | |
## | |
## This file is part of Supermodel. | |
## | |
## Supermodel is free software: you can redistribute it and/or modify it under | |
## the terms of the GNU General Public License as published by the Free | |
## Software Foundation, either version 3 of the License, or (at your option) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"categoriesToShow": [ | |
"Key Concepts", | |
"Mathematical Practices", | |
"Learning Objectives" | |
], | |
"questionTagsById": [ | |
{ | |
"id": 568229, | |
"question_type": "questions/multiple_choice", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You have an array of characters (string) that may be '1', '0' o '*'. e.g. 10*00*0. The program needs to | |
//generate an output of all the possible combinations by replacing * with an 0 and 1. I.e. input> 10**0 | |
//output> 10000, 10010, 10100, 10110. Input > *0 output > 00, 10. | |
function findOcurrencesOf(character = "*", array) { | |
let occ = []; | |
for (let i = 0; i < array.length; i++) { | |
if (array[i] === character) { | |
occ.push(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You have an array of characters (string) that may be '1', '0' o '*'. e.g. 10*00*0. The program needs to | |
//generate an output of all the possible combinations by replacing * with an 0 and 1. I.e. input> 10**0 | |
//output> 10000, 10010, 10100, 10110. Input > *0 output > 00, 10. | |
function findOcurrencesOf(character = "*", array) { | |
let occ = []; | |
for (let i = 0; i < array.length; i++) { | |
if (array[i] === character) { | |
occ.push(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s https://www.bancogalicia.com/cotizacion/cotizar\?currencyId\=02\"eType\=SU\"eId\=999 | python -c "import sys, json; obj = json.load(sys.stdin);print('Dolar compra: ' + obj['buy']); print('Dolar venta: '+ obj['sell'])" |
OlderNewer