Skip to content

Instantly share code, notes, and snippets.

View erikfloresq's full-sized avatar
Open your eyes

Erik Flores erikfloresq

Open your eyes
View GitHub Profile
class TableCollectionViewController: UIViewController {
let collectionView : UICollectionView = {
let layout = UICollectionViewCompositionalLayout.list(using: UICollectionLayoutListConfiguration(appearance: .plain))
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView.translatesAutoresizingMaskIntoConstraints = false
return collectionView
}()
lazy var collectionDataSource = CollectionDataSource(collectionView: collectionView)
import UIKit
class ViewController: UIViewController {
let tableView: UITableView = {
let tableView = UITableView()
tableView.translatesAutoresizingMaskIntoConstraints = false
tableView.register(ItemCell.self, forCellReuseIdentifier: "ItemCell")
return tableView
}()
lazy var tableViewDataSource = TableViewDataSource(tableView: tableView)
@erikfloresq
erikfloresq / xcode-downloader.rb
Created November 23, 2019 13:34 — forked from manishpathak99/xcode-downloader.rb
Script for reliably downloading binaries (e.g. Xcode) from Apple's CDN
#!/usr/bin/env ruby
print "What is the URL of your Apple Downloads resource?\nURL:"
url = gets.strip
print "What is the ADCDownloadAuth cookie token:\nADCDownloadAuth: "
token = gets.strip
command = "aria2c --header \"Host: adcdownload.apple.com\" --header \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\" --header \"Upgrade-Insecure-Requests: 1\" --header \"Cookie: ADCDownloadAuth=#{token}\" --header \"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1\" --header \"Accept-Language: en-us\" -x 16 -s 16 #{url} -d ~/Downloads"
@erikfloresq
erikfloresq / FirebaseMessagingService.java
Last active March 24, 2021 04:27
Android notifications
public class FirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(@NotNull RemoteMessage remoteMessage) {
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ
Log.d(ContentValues.TAG, "From: " + remoteMessage.getFrom());
// Check if message contains a data payload.
if (!remoteMessage.getData().isEmpty()) {
@erikfloresq
erikfloresq / PostScript Send Slack Message
Created September 8, 2017 16:42
Scripts for XcodeServer
PAYLOAD="{\"channel\": \"#xcodeserver\", \"username\": \"DebugBot\", \"text\": \"${XCS_BOT_NAME} finished with status: ${XCS_INTEGRATION_RESULT}\", \"icon_emoji\": \":robot_face:\"}"
echo $PAYLOAD
curl -X POST --data-urlencode "payload=${PAYLOAD}" https://hooks.slack.com/services/xxxxxx
@erikfloresq
erikfloresq / itunes.sh
Created July 27, 2017 19:03 — forked from rkumar/itunes.sh
control iTunes from command line
#!/bin/bash
#
####################################
# iTunes Command Line Control v1.0
# written by David Schlosnagle
# created 2001.11.08
# edit 2010.06.01 rahul kumar
####################################
showHelp () {
@erikfloresq
erikfloresq / Setup-2017.md
Created May 3, 2017 16:50
my personal setup in 2017

Setup 2017

  • zsh
  • iterm (sometimes hyper)
  • .dotfiles
  • Atom with Nuclide
  • Docker
  • Fastlane
  • xcode
  • macos
@erikfloresq
erikfloresq / ios_readme_generator_action.rb
Created April 25, 2017 17:21
Añadiendo ios_readme_generator en un plugin de Fastlane
module Fastlane
module Actions
class IosReadmeGenerateAction < Action
def self.run(params)
# Creamos una instancia de nuestro helper donde tenemos desarrolladora la funcion addValue
ios_readme = Helper::IosReadmeGenerateHelper.new
# Obtengo el valor las opciones ingresadas, las opciones las declaramos en la parte inferior
app_name = ios_readme.addValue("app_name",params[:app_name])
app_id = ios_readme.addValue("app_id",params[:app_id])
@erikfloresq
erikfloresq / Fastfile
Last active April 25, 2017 16:15
Fastfile para un preRelease
# Definimos la version minima de fastlane con la que vamos a trabajar
fastlane_version "2.20.0"
# Variables globales
# Nos ayudara a no estar repitiendo datos en nuestros lane y también para realizar cambios mas rápidos en nuestras configuraciones
application_name = "Weriklandia"
application_id = "pe.com.orbis.Weriklandia"
application_language = "Swift 3"
application_deploy_target = "iOS 9"
# Obtenemos la URL base de nuestro proyecto usnado sh, con sh podemos ejecutar comandos de terminal
@erikfloresq
erikfloresq / Fastfile
Last active April 24, 2017 23:55
Instalación ad-hoc
default_platform :ios
platform :ios do
# Aqui es donde colocamos todas las acciones o configuraciones que queremos reliazar antes que se ejecuten todos los lane
before_all do
# Porejemplo podemos agregar el hook de slack para no estar agregandolo cada vez que usemos la acción de slack
ENV["SLACK_URL"] = "https://hooks.slack.com/services/*******"
end