Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View omarojo's full-sized avatar

Omar Juarez omarojo

View GitHub Profile
@omarojo
omarojo / Podfile.lock
Created August 9, 2016 22:28
podfile.lock
PODS:
- AppsFlyer-SDK (2.5.3.15.1)
- Bolts (1.6.0):
- Bolts/AppLinks (= 1.6.0)
- Bolts/Tasks (= 1.6.0)
- Bolts/AppLinks (1.6.0):
- Bolts/Tasks
- Bolts/Tasks (1.6.0)
- FBSDKCoreKit (4.7.0):
- Bolts (~> 1.1)
2016-08-11 11:31:14.785 Generate[471:146048] Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.
2016-08-11 11:31:15.828 Generate[471:146048] Received memory warning.
2016-08-11 11:31:18.595 Generate[471:146048] Welcome
2016-08-11 11:31:19.296 Generate[471:146048] Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.
2016-08-11 11:31:19.306 Generate[471:146048] Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.
2016-08-11 11:31:19.308 Generate[471:146048] Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.
@omarojo
omarojo / gist:934863e6f4ddf4bb3f0de7445da573cd
Last active January 19, 2017 20:58
GPUImage newFrameAvailable
self.rawG8OutputTarget = [[GPUImageRawDataOutput alloc] initWithImageSize: aspectSize resultsInBGRAFormat:YES];
[filterChain.output addTarget:self.rawG8OutputTarget];
__weak GPUImageRawDataOutput *weakRawOutput = self.rawG8OutputTarget;
[self.rawG8OutputTarget setNewFrameAvailableBlock:^{
GLubyte *outputBytes = [weakRawOutput rawBytesForImage];
NSInteger bytesPerRow = [weakRawOutput bytesPerRowInOutput];
//I use this variables to create the image to be streamed.
}];
@omarojo
omarojo / gist:e902fadb1d89de17333466b421bb4887
Last active February 22, 2017 04:56
Facebook GraphRequest empty Alert
let userId = AccessToken.current?.userId
let path = "/"+userId!+"/live_videos"
var title = "the title"
let descript = "my description"
let request : GraphRequest = GraphRequest(graphPath: path,
parameters:["title": title!,
"description": descript,
"privacy":"{'value':'SELF'}",
"save_vod": true,
"fields": ""],
@omarojo
omarojo / Polling.swift
Last active May 3, 2017 11:35
Polling with Timer
func startPollingComments(){
if let cStream = currentStream, connected == true{
//the code would not continue if its NOT connected. hence the Timer shcedule will not be generated, this stops the polling
let stream = cStream as! FBLiveStream
stream.getLastComments(completion: { (comments, error) in
if (error == nil){
self.onCommentsUpdate?(comments as! [Dictionary<String, Any>])
}
Timer.scheduledTimer(withTimeInterval: 5.0, repeats: false, block: {timer in
self.startPollingComments()
@omarojo
omarojo / G8LiveStreamer.swift
Last active May 4, 2017 11:04
LF Custom Live Content
import UIKit
import AVFoundation
import lf
import GPUImage
import VideoToolbox
class G8LiveStreamer: NSObject {
var streamUrl:String?
@omarojo
omarojo / StaticPixelBuffer.swift
Created May 5, 2017 14:53
LF Custom Static Buffer
import lf
import UIKit
import XCGLogger
import AVFoundation
let sampleRate:Double = 44_100
final class LiveViewController: UIViewController {
//.....
@omarojo
omarojo / UnityTriggerAnim.cs
Created November 10, 2017 11:44
Unity Trigger Animation Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
namespace Vuforia{
public class ImageTargetAnimTrigger: MonoBehaviour,
ITrackableEventHandler
{
private TrackableBehaviour mTrackableBehaviour;
@omarojo
omarojo / blackandWhite.fsh
Created March 27, 2018 22:06
Black and White Shader (GPUImage)
precision highp float;
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
void main()
{
highp vec4 textureColor;
highp vec4 rCol;
highp vec4 gCol;
@omarojo
omarojo / ContrastShader.fsh
Created March 27, 2018 22:08
Contrast Shader (GPUImage)
varying vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform float contrast;
void main()
{
vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
gl_FragColor = vec4(((textureColor.rgb - vec3(0.5)) * contrast + vec3(0.5)), textureColor.w);