Skip to content

Instantly share code, notes, and snippets.

import { TRANSFER_SPLASH_HEADER } from 'assets/images/constants';
import { NtwrkLogoFilled } from 'assets/svgs/NtwrkLogo';
import Button, { ButtonStyle } from 'components/Button';
import Image from 'components/Image';
import Text, { TextType } from 'components/Text';
import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
function Tile(): JSX.Element {
// 1. paste this section to start recording
let mediaRecorder;
let recordedBlobs = [];
function handleDataAvailable(event) {
console.log('handleDataAvailable', event);
if (event.data && event.data.size > 0) {
recordedBlobs.push(event.data);
}
}
let options = {mimeType: 'video/webm;codecs=vp9,opus'};
@alekhinen
alekhinen / m84+mic-permissions.patch
Created November 13, 2020 00:11
Patch for WebRTC M84 to not prompt mic permissions for "viewers" of a WebRTC call on iOS
diff --git a/sdk/objc/components/audio/RTCAudioSessionConfiguration.m b/sdk/objc/components/audio/RTCAudioSessionConfiguration.m
index 39e9ac13ec..a11a0037cd 100644
--- a/sdk/objc/components/audio/RTCAudioSessionConfiguration.m
+++ b/sdk/objc/components/audio/RTCAudioSessionConfiguration.m
@@ -65,15 +65,16 @@ static RTC_OBJC_TYPE(RTCAudioSessionConfiguration) *gWebRTCConfiguration = nil;
- (instancetype)init {
if (self = [super init]) {
+ AVAudioSession *session = [AVAudioSession sharedInstance];
// Use a category which supports simultaneous recording and playback.
@alekhinen
alekhinen / SampleComponent.tsx
Created January 16, 2020 18:40
Covers the lifecycle hooks of a react class component.
import React from 'react';
interface OwnProps {
// add some properties.
}
interface OwnState {
// add some properties.
}
@alekhinen
alekhinen / rhythm.pde
Created January 24, 2017 17:53
processing visual rhythm
int FRAME_RATE = 30;
int BPM = 80;
float FPB = FRAME_RATE * 60.0 / BPM;
float BPF = BPM / 60.0 / FRAME_RATE;
float beatCount = 0.0;
int nodeSize = 20;
@alekhinen
alekhinen / guiSendMessage.applescript
Created July 21, 2015 18:54
Programmatically send iMessage via GUI through Terminal
on run {targetBuddyPhone, targetMessage}
tell application "System Events"
tell application "Messages" to activate
tell process "Messages"
click menu item "New Message" of menu "file" of menu bar 1
set input to targetMessage as text
delay 1
keystroke targetBuddyPhone
keystroke return
keystroke tab
@alekhinen
alekhinen / sendMessage.applescript
Created July 21, 2015 18:52
Programmatically send an iMessage from Terminal
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
@alekhinen
alekhinen / example.html
Created March 22, 2015 01:51
Example responsive divs.
<!DOCTYPE html>
<html>
<head>
<title>Responsive Divs</title>
<link rel="stylesheet" type="text/css" href="./example.css">
</head>
<body>
<div class="section-container">
<div class="section">
<h3>container 1</h3>
@alekhinen
alekhinen / example.css
Created March 22, 2015 01:50
Styling for example.html
h3 {
font-family: "Helvetica-Neue", sans-serif;
font-size: 1.5em;
}
.section-container {
max-width: 1100px;
background-color: black;
margin: auto;
overflow: hidden;
@alekhinen
alekhinen / index.html.haml
Created July 19, 2014 16:23
Index page for views/blog/
.page-content-container
%h1.big blog
.padder100
.metaPostsContainer
/////////////////////////////////////////////////////////////////////////////
// Pull each post out of @posts /////////////////////////////////////////////
- @posts.each do |post|
// Set variables. /////////////////////////////////////
- @type = post["type"] # the type of post