Skip to content

Instantly share code, notes, and snippets.

View axelrivera's full-sized avatar

Axel Rivera axelrivera

View GitHub Profile
@axelrivera
axelrivera / newsletter.md
Last active April 18, 2025 03:26
Sample markdown result for AI generated newsletter.

Commentary

In a week dominated by groundbreaking developments in AI, OpenAI has once again stolen the spotlight with its latest release, GPT-4.1. This new series not only promises to elevate coding capabilities but also sets the stage for a pricing showdown among tech giants. From its ability to process vast amounts of data to its cost-effective models that challenge even Google's innovations, OpenAI is redefining what's possible in the AI landscape. Meanwhile, Cohere's advancements in multimodal search and Meta's potential shake-up in the social media realm add even more intrigue to the evolving tech scene. Dive into this week's newsletter to explore how these innovations are paving the way for the future of technology.

Big Tech

The possibility of Meta being compelled to divest its holdings in Instagram and WhatsApp is stirring significant debate. The timing of t

@axelrivera
axelrivera / MKMapView+ShowHide.swift
Created May 1, 2023 23:29 — forked from danielrotaermel/MKMapView+ShowHide.swift
MKAnnotationView extensions to show/hide annotations completely
//
// MKMapView+ShowHide.swift
//
// Created by Daniel Rotärmel on 27.10.20.
//
import MapKit
// MKAnnotationView extensions to show/hide annotations completely
extension MKMapView {
import Foundation
typealias TableInfo = [String: Any]
typealias TableSectionArray = [TableSection]
typealias TableRowArray = [TableRow]
struct TableSection {
var groupIdentifier: String?
var identifier: String?
var title: String?
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
upColor = ParamColor("Up Color", colorBlack);
downColor = ParamColor("Down Color", colorRed);
Plot(C, "Close", IIf(C >= Ref(C, -1), upColor, downColor), styleBar);
extension NSURLSession {
class func sendSynchronousRequest(request: NSURLRequest, inout returningResponse: NSHTTPURLResponse?, inout error: NSError?) -> NSData? {
var data: NSData?
var sem: dispatch_semaphore_t
sem = dispatch_semaphore_create(0)
NSURLSession.sharedSession().dataTaskWithRequest(request) { (requestData, requestResponse, requestError) in
@axelrivera
axelrivera / TableUtils.swift
Created November 29, 2015 18:42
Custom data structures to help with complex UITableViews
import UIKit
typealias TableInfo = [String: Any]
typealias TableSectionArray = [TableSection]
typealias TableRowArray = [TableRow]
enum TableRowType {
case Text
case Detail
case Subtitle
@axelrivera
axelrivera / UIColor+Hex.swift
Created December 29, 2014 14:12
UIColor+Hex
extension UIColor {
convenience init(hex: NSInteger) {
self.init(hex: hex, alpha: 1.0)
}
convenience init (hex: NSInteger, alpha: CGFloat) {
let red = CGFloat((hex & 0xFF0000) >> 16) / 255.0
let green = CGFloat((hex & 0xFF00) >> 8) / 255.0
let blue = CGFloat((hex & 0xFF)) / 255.0
@axelrivera
axelrivera / SwiftUtilities.swift
Last active August 3, 2017 15:40
A repository of my frequently used methods and macros in swift
//
// SwiftUtilities.swift
//
// Created by Axel Rivera on 12/21/14.
// Copyright (c) 2014 Axel Rivera. All rights reserved.
//
import Foundation
// MARK: - Macros
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
// do some stuff in the background
let string = "my string"
// remove if you don't need to call the main queue
dispatch_async(dispatch_get_main_queue(), {
// do some stuff in the main queue
// mostly call the UI
})
// end of remove
var query: PFQuery = PFQuery(className: "userPhoto")
query.findObjectsInBackgroundWithBlock { [weak self] (objects, error) -> Void in
if let weakSelf = self {
println("Got \(objects.count) entries")
weakSelf.feedData = objects
weakSelf.tableView.reloadData()
}
}