Skip to content

Instantly share code, notes, and snippets.

View josellausas's full-sized avatar
🏠
Working from home

Jose josellausas

🏠
Working from home
View GitHub Profile
NSManagedObjectContext* _context;
// Setup the Core Data:
NSManagedObjectModel *model = [NSManagedObjectModel mergedModelFromBundles:[NSArray arrayWithObject:[NSBundle mainBundle]]];
NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];
_context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
_context.persistentStoreCoordinator = psc;
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
#!/bin/sh
# kills Simulator if running, then erases all simulator data
killall "Simulator"; xcrun simctl erase all
echo "Done cleaning simulator"
@josellausas
josellausas / ContractKillerEspañol.md
Created June 16, 2016 18:33
Contract Killer en Español

Fecha: [fecha]

Entre nosotros [nuestra empresa] y ustedes [nombre del cliente]

Compromiso:

Nuestro compromiso es hacer siempre lo mejor para satisfacer las necesidades y cubrir las expectativas de nuestros clientes, y es importante que ambas partes tengamos las cosas claras y por escrito de manera que todos entendamos qué es qué, quién debe hacer qué, cuándo debe hacerlo, y qué va a pasar si algo no sale como se planeó. Este convenio es muy sencillo y no encontrarán en él complicados términos legales o largos párrafos difíciles de entender. Buscamos lo mejor para ambas partes, ahora y en el futuro.

Antecedentes:

@josellausas
josellausas / Testing environment with Tmuxinator.md
Last active November 14, 2016 20:06
Instructions for setting up a testing environment with Tmuxinator

Tmuxinator test environment

  1. Install things

Install tmux and tmuxinator (I used brew and gem install tmuxinator)

  1. Create a new tmuxinator project

@josellausas
josellausas / ElasticSearchFix.sh
Created December 13, 2016 18:30
Script to fix Elastic search
clear
echo ""
echo "------------------"
echo "Elastic Search Fix"
echo "------------------"
echo ""
echo "[*] Creating Directory ..."
sudo mkdir /var/run/elasticsearch
echo ""
echo "[*] Chowning Directory ..."
@josellausas
josellausas / install_lapis.sh
Created April 17, 2017 03:20
Install Lapis on Raspberry Pi 3
#!/usr/bin/env bash
# This installs Leafo's Lapis (http://leafo.net/lapis/) on Raspberry Pi 3
sudo apt-get update &&\
sudo apt-get upgrade &&\
sudo apt-get install nginx postgresql lua luajit libpq-dev &&\
sudo apt-get install libpcre3 libpcre3-dev libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential curl &&\
sudo apt-get update &&\
# Install Openresty
mkdir openresty &&\
cd openresty &&\
@josellausas
josellausas / exists.bash
Created May 7, 2017 01:32
Checks if a command exists in bash
exists()
{
command -v "$1" >/dev/null 2>&1
}
if exists figlet; then
figlet "Hello"
else
echo ''
echo '----------------'
@josellausas
josellausas / clean_docker.sh
Created May 15, 2017 14:06
Cleans docker stale obects.
#!/usr/bin/env bash
# Remove dangling images
docker rmi $(docker images -f dangling=true -q)
# Remove all exited containers
docker rm $(docker ps -a -f status=exited -q)
# Remove dangling volumes
docker volume rm $(docker volume ls -f dangling=true -q)
@josellausas
josellausas / restart_postgres.sh
Created May 18, 2017 18:01
Restart postgresql
sudo service postgresql restart