Skip to content

Instantly share code, notes, and snippets.

View codeactual's full-sized avatar

David Smith codeactual

  • Found Apparatus
  • Portland, OR
View GitHub Profile
@codeactual
codeactual / VideoPlayerControls.swift
Created September 9, 2021 16:43 — forked from Martini024/VideoHelper.swift
SwiftUI: Rewrite iOS Photos Video Scrubber
import SwiftUI
import AVKit
struct VideoPlayerControls: View {
let player: AVPlayer
@Binding var currentTime: CGFloat
var height: CGFloat = 50
@codeactual
codeactual / switchgo.sh
Created September 24, 2019 12:20 — forked from fatih/switchgo.sh
Switch between go version using https://github.com/golang/dl
function switchgo() {
version=$1
if [ -z $version ]; then
echo "Usage: switchgo [version]"
return
fi
if ! command -v "go$version" > /dev/null 2>&1; then
echo "version does not exist, download with: "
echo " go get golang.org/dl/${version}"
$ cat test.js
function foo () { while (true) { } }
function bar () { return foo(); }
bar();
$ node test.js &
$ gdb attach $(pidof node)
0x00000bf778c63d5f in ?? ()
(gdb) b v8::internal::Runtime_StackGuard
Breakpoint 1 at 0x84a1f0
(gdb) print 'v8::V8::TerminateExecution'(0)
@codeactual
codeactual / postgres.go
Created March 28, 2018 19:40 — forked from rivo/postgres.go
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"
@codeactual
codeactual / trace-to-mp4.js
Created March 4, 2017 02:32 — forked from krisselden/trace-to-mp4.js
Make an mp4 out of a Chrome DevTools trace with screenshots.
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const execSync = require('child_process').execSync;
if (process.argv.length < 3) {
console.log(`node ${path.relative('.', process.argv[1])} [DevToolsProfile]`);
process.exit(1);
}
let traceFile = path.resolve(process.argv[2])
@codeactual
codeactual / Concurrent map benchmarks
Created January 24, 2016 03:21 — forked from donovanhide/Concurrent map benchmarks
Benchmarks for different implementations of a concurrent map
To benchmark:
go test -bench=".*" > machine_description.txt