Skip to content

Instantly share code, notes, and snippets.

View frr149's full-sized avatar

Fernando Rodriguez Romero frr149

View GitHub Profile
@frr149
frr149 / lsaber
Created April 20, 2018 04:31 — forked from sumpygump/lsaber
ASCII Lightsaber
#!/bin/bash
######################################################################
# The ASCII lightsaber #
# #
# By: Jansen Price <jansen.price@gmail.com> #
# November 19, 2015 #
# ▁▁▁▁▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ #
# |▍░▐░░▣░▒░▒░▒▕| ▌ #
# ▔▔▔▔▔▔▔▔▔▝▔▔▔ ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ #

¿Macs Seguros?

Quién no recuerda aquellos anuncios famosos de "Hola, soy un Mac. Hola soy un PC"? En ellos, se intentaba vender el mac como un dispositivo más cómodo, más "cool", y sin duda, más seguro. Desgraciadamente, nada más lejos de la verdad. Tanto el chico mac como el chico PC del anuncio están con el culo al aire.

Cómo mejorar la seguridad de tu mac

Lo primero que deberías hacer, es no conectarte a la red usando una cuenta con permisos de administrador. Por supuesto, ésta es la configuración por defecto en todo mac. Antes era necesario para poder programar con Xcode, pero hoy en día ya no es así. basta un usuario mondo lirondo. Por lo tanto, deberías de tener 2 usuarios, uno con permisos de administración (que sólo usas para tareas puntuales, como instalar software en /Applications) y otro para el uso diario.

Otro paso fundamental, es el uso de File Vault, que mantiene todos los datos de tu SSD encriptados. El encriptado y desencriptado se hace por hardware, con lo cual no hay impacto percep

//MARK: - Loading
func loadFromLocalFile(fileName name: String, bundle: Bundle = Bundle.main) throws -> JSONArray{
if let url = bundle.URLForResource(name),
let data = try? Data(contentsOf: url),
let maybeArray = try? JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.mutableContainers) as? JSONArray,
let array = maybeArray{
return array
//
// CoreDataStack.swift
//
//
// Created by Fernando Rodríguez Romero on 21/02/16.
//
import CoreData
// MARK: - TypeAliases
//
// CoreDataTableViewController.swift
//
//
// Created by Fernando Rodríguez Romero on 22/02/16.
// Copyright © 2016 udacity.com. All rights reserved.
//
import UIKit
import CoreData
// Within the init: Create a background context child of main context
backgroundContext = NSManagedObjectContext(concurrencyType: .
// MARK: - Batch processing in the background
extension CoreDataStack{
typealias Batch=(workerContext: NSManagedObjectContext) -> ()
func performBackgroundBatchOperation(batch: Batch){
backgroundContext.performBlock(){
func backgroundLoad(){
if let coord = self.stack.context.persistentStoreCoordinator{
let bckgContext = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
bckgContext.persistentStoreCoordinator = coord
func backgroundLoad(){
if let coord = self.stack.context.persistentStoreCoordinator{
let bckgContext = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
bckgContext.persistentStoreCoordinator = coord
[
{
"authors": "Marijn Haverbeke ",
"image_url": "http://hackershelf.com/media/cache/e5/27/e527064919530802af898a4798318ab9.jpg",
"pdf_url": "http://eloquentjavascript.net/Eloquent_JavaScript.pdf",
"tags": "javascript",
"title": "Eloquent JavaScript"
},
{
extension NSURLSession{
// This extension provides an API that hides any explicit use of GCD
// functions.
// Just make sure you use the correct closure to update your UI(completionHandler:) and
// everything should work fine.
// If you wish to understand this code and know more about GCD and how to
// run closures in the background, make sure to check the GCD course