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 / 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 gcc@4.9 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;