Skip to content

Instantly share code, notes, and snippets.

@nerdo
nerdo / changed.diff
Created April 16, 2018 21:05 — forked from kapejod/changed.diff
How i have built WebRTC for tvOs (some time ago....might not apply anymore)
diff --git a/webrtc/base/posix.cc b/webrtc/base/posix.cc
index 0eb24ee..7e48273 100644
--- a/webrtc/base/posix.cc
+++ b/webrtc/base/posix.cc
@@ -44,7 +44,7 @@ enum {
bool RunAsDaemon(const char *file, const char *const argv[]) {
// Fork intermediate child to daemonize.
- pid_t pid = fork();
+ pid_t pid = -1;
@nerdo
nerdo / Main.storyboard
Last active March 23, 2018 16:37
ReSwift Tic Tac Toe
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
@nerdo
nerdo / CopyableLabel.swift
Last active February 11, 2018 17:28 — forked from zyrx/CopyableLabel.swift
Make UILabel Copyable in Swift 4. Special thanks to Stephen Radford and his "Make UILabel Copyable in Swift" article http://stephenradford.me/make-uilabel-copyable/
//
// CopyableLabel.swift
//
// Created by Lech H. Conde on 01/11/16.
// Copyright © 2016 Mavels Software & Consulting. All rights reserved.
//
import UIKit
class CopyableLabel: UILabel {
@nerdo
nerdo / BlockBasedSelector.h
Created February 9, 2018 23:24 — forked from cprovatas/BlockBasedSelector.h
Block-Based Selectors in Swift
//
// BlockBasedSelector.h
//
// Created by Charlton Provatas on 11/2/17.
// Copyright © 2017 CharltonProvatas. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BlockBasedSelector : NSObject
@nerdo
nerdo / CSS for <sup> and <sub>
Created November 22, 2017 16:34 — forked from unruthless/CSS for <sup> and <sub>
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@nerdo
nerdo / rbenv-ruby187-highsierra.sh
Created October 25, 2017 20:23 — forked from yatsu/rbenv-ruby187-macos.sh
Install ruby-1.8.7 with rbenv on macOS High Sierra (10.13)
#!/bin/sh
# 1) Install HomeBrew
# 2) brew install openssl [email protected] rbenv
# 3) Setup rbenv
CC=gcc-4.9 \
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls -I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
rbenv install 1.8.7-p375
@nerdo
nerdo / DebouncedJob.php
Last active October 16, 2017 19:27 — forked from cabloo/DebouncedJob.php
Debounced Laravel 5.3 Jobs
<?php
// Based on https://gist.github.com/cabloo/328e39a19afeaed1256f83bd4a0ba4bc
// The maxWait option from the previous revision was removed, but can easily be added back in as feature.
namespace App\Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\DispatchesJobs;
<?php
// Foundation\Application.php
/**
* Base application created for the purpose of setting up a custom router in L5, per
* https://laracasts.com/discuss/channels/general-discussion/can-i-find-the-way-to-extend-router-or-replace-customer-router-class-on-laravel5
*/
namespace App\Foundation;
use App\Providers\RoutingServiceProvider; // your custom RoutingServiceProvider
use Illuminate\Events\EventServiceProvider;