Skip to content

Instantly share code, notes, and snippets.

View gsabran's full-sized avatar

Guillaume Sabran gsabran

View GitHub Profile
# Realm, attempt 1
apple_library(
name = "Realm",
configs = {
"Debug": {
"IPHONEOS_DEPLOYMENT_TARGET": "11.0",
"SDKROOT": "iphoneos",
"GCC_OPTIMIZATION_LEVEL": "0",
"SWIFT_OPTIMIZATION_LEVEL": "-Onone",
@gsabran
gsabran / UniquelyInstanciatedModels.swift
Created January 21, 2017 20:50
Example to instantiate models only once and update them
class Weak<T: AnyObject> {
weak var value : T?
init (value: T) {
self.value = value
}
}
public class Model {
let id: String
private init(from payload: JSON) {
@gsabran
gsabran / test-av-player-layer.swift
Last active February 18, 2023 06:26
Test using AVPlayerLayer as texture input (using Metal / iOS 10)
import UIKit
import SceneKit
import SpriteKit
import AVFoundation
class ViewController: UIViewController {
@IBOutlet weak var scnView: SCNView!
var videoLayer: AVPlayerLayer!
var videoPlayer: AVPlayer!
@gsabran
gsabran / meteorFacebookMobileLogin.js
Last active November 17, 2017 04:04
A route that takes an access token from Facebook as an input and behave consistently with Meteor accounts
import { Accounts } from 'meteor/accounts-base';
import { ServiceConfiguration } from 'meteor/service-configuration';
// currently you need to use a local version of the facebook package with this change:
// https://github.com/meteor/meteor/pull/7550
import { Facebook } from 'meteor/facebook';
import { HTTP } from 'meteor/http';
import { OAuth } from 'meteor/oauth';