Skip to content

Instantly share code, notes, and snippets.

View ObjSal's full-sized avatar
🎯
Focusing

Salvador Guerrero ObjSal

🎯
Focusing
View GitHub Profile
@ObjSal
ObjSal / GIFLoader.h
Last active August 29, 2015 14:27 — forked from andrei512/GIFLoader.h
GIFLoader - simple GIF support for iOS
//
// GIFLoader.h
// AnimatedGifExample
//
// Created by Andrei on 10/15/12.
// Copyright (c) 2012 Whatevra. All rights reserved.
//
#import <Foundation/Foundation.h>
@ObjSal
ObjSal / LICENSE
Last active November 1, 2015 18:47
NSUserDefaults+SynchronizeBlockCategory
The MIT License (MIT)
Copyright (c) 2015 Salvador Guerrero
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:
@ObjSal
ObjSal / whatsapp-image-compression
Last active November 17, 2015 21:45 — forked from akshay1188/whatsapp-image-compression
Whatsapp like image compression
- (UIImage *)compressImage:(UIImage *)image{
float actualHeight = image.size.height;
float actualWidth = image.size.width;
float maxHeight = 600.0;
float maxWidth = 800.0;
float imgRatio = actualWidth/actualHeight;
float maxRatio = maxWidth/maxHeight;
float compressionQuality = 0.5;//50 percent compression
if (actualHeight > maxHeight || actualWidth > maxWidth) {
@ObjSal
ObjSal / List.h
Last active March 16, 2016 03:32
singly-linked list
//
// List.h
// Data Structures
//
// Created by Salvador Guerrero on 3/15/16.
// Copyright © 2016 ByteApps. All rights reserved.
//
/*
* Singly-linked list
@ObjSal
ObjSal / Stack.h
Last active March 16, 2016 04:19
Stack using singly-linked list
//
// Stack.h
// Data Structures
//
// Created by Salvador Guerrero on 3/15/16.
// Copyright © 2016 ByteApps. All rights reserved.
//
/*
* Stack using singly-linked list
@ObjSal
ObjSal / Queue.h
Last active March 16, 2016 04:49
Queue using singly-linked list
//
// Queue.h
// Data Structures
//
// Created by Salvador Guerrero on 3/15/16.
// Copyright © 2016 ByteApps. All rights reserved.
//
/*
* Queue using singly-linked list
//
// BinaryTree.h
// Data Structures
//
// Created by Salvador Guerrero on 3/16/16.
// Copyright © 2016 ByteApps. All rights reserved.
//
/*
* Binary Tree
@ObjSal
ObjSal / divide_files_into_folders.sh
Created August 10, 2016 03:35
This script moves all mp3 files in a folder to different directories containing 255 files each, I used this script because one of my Dad's vehicle can only hols 255 per folder and he had 1,000+ songs in a USB drive
#!/bin/bash
# The first folder moves only 253 files, but that's ok for my use =)
folder_count=1
file_count=1
pushd /Volumes/NO\ NAME/
mkdir ${folder_count}
for f in *.mp3; do
@ObjSal
ObjSal / discover.py
Created January 2, 2017 21:28 — forked from jcarbaugh/discover.py
DIAL examples
import httplib
import socket
import StringIO
# generic
SSDP_ALL = 'ssdp:all'
UPNP_ROOT = 'upnp:rootdevice'
# devices
DIAL = 'urn:dial-multiscreen-org:service:dial:1'
@ObjSal
ObjSal / Makefile.iphone
Last active May 22, 2019 19:42 — forked from danomatika/Makefile.iphone
FreeImage Makefile for iOS updated for XCode 7.3, tested with macOS 10.11.6 & XCode 7.3
# Configuration for iPhone OS, making static libs
# this will generate both iPhone (arm) and iPhoneSimulator (i386) libs
include Makefile.srcs
CFLAGS = -std=c99 -g -O2 -Wall -Wmissing-prototypes -ffast-math -fno-strict-aliasing -D__ANSI__ -emit-llvm -Wno-c++11-narrowing -Wno-implicit-function-declaration
CXXFLAGS = -std=gnu++14 -stdlib=libc++ -D__ANSI__ -emit-llvm -Wno-c++11-narrowing -Wno-implicit-function-declaration -fvisibility-inlines-hidden
IPHONEOS_DEPLOYMENT_TARGET = 9.3
MACOSX_DEPLOYMENT_TARGET = 10.7