Skip to content

Instantly share code, notes, and snippets.

View DanielCardonaRojas's full-sized avatar

Daniel Cardona Rojas DanielCardonaRojas

View GitHub Profile
@Bersaelor
Bersaelor / Matrix4+Extensions.swift
Last active September 11, 2020 07:58
Applying SCNMatrix4 to SCNVector3 (Couldn't find this in SceneKit)
//
// Matrix4+Extensions.swift
// StARs
//
// Created by Konrad Feiler on 17.12.17.
// Copyright © 2017 Konrad Feiler. All rights reserved.
//
import Foundation
import SceneKit
@mbigatti
mbigatti / UIView+FirstResponder.swift
Created July 10, 2014 15:40
A classical first responder finder using Swift.
import UIKit
extension UIView {
func currentFirstResponder() -> UIResponder? {
if self.isFirstResponder() {
return self
}
for view in self.subviews {
if let responder = view.currentFirstResponder() {
@brikis98
brikis98 / echo.js
Last active February 15, 2019 19:30
Echo server in socket.io
var io = require('socket.io').listen(80);
io.sockets.on('connection', function (socket) {
console.log("Someone just connected!");
// Echo back messages from the client
socket.on('message', function (message) {
console.log("Got message: " + message);
socket.emit('message', message);
});