Skip to content

Instantly share code, notes, and snippets.

View jzucker2's full-sized avatar

Jordan Zucker jzucker2

  • PubNub
  • San Francisco
View GitHub Profile
@the-spyke
the-spyke / pipewire.md
Last active June 18, 2024 19:42
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@nixta
nixta / geofencing.js
Last active May 14, 2017 13:21
A PubNub Geofencing Block (See structure of sample services below at lines 16&17).
export default (request) => {
let query = require('codec/query_string');
// return if the block does not have anything to analyze
if (!query) {
return request.ok();
}
// Require console to print debug information
let console = require('console');
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)
@jzucker2
jzucker2 / .gitignore
Last active August 29, 2015 14:14
My Obj-C gitignore
# Mac
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
@jzucker2
jzucker2 / .gitconfig
Last active August 29, 2015 14:13
My ps1/git completion
[user]
email = jordan.zucker@gmail.com
name = Jordan Zucker
[alias]
cm = commit -m
swap = checkout -
lc = log ORIG_HEAD.. --stat --no-merges
mkbr = checkout -b
sm = submodule update --init --recursive
llog = log --date=local
@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active November 30, 2022 09:27
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@jazzychad
jazzychad / gist:0d730446502902ad3597
Created April 29, 2014 22:51
PS1 w/ git branch
[\h \[\033[0;36m\]\W\[\033[0m\]$(__git_ps1 " \[\033[1;32m\](%s)\[\033[0m\]")]\$
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #