This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2/KEY" | |
TWITTER_URL="rtmp://va.pscp.tv:80/x/KEY" | |
TWITCH_URL="rtmp://live.twitch.tv/app/KEY" | |
YOUTUBE_BITRATE="9M" | |
TWITTER_BITRATE="9M" | |
TWITCH_BITRATE="7M" | |
LOCAL_RTMP="rtmp://0.0.0.0:1935" | |
PIPE_PATH_BASE="/tmp/live_stream" | |
PLATFORMS=("youtube" "twitter" "twitch") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set up variables | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2/KEY" | |
TWITTER_URL="rtmp://va.pscp.tv:80/x/KEY" | |
TWITCH_URL="rtmp://live.twitch.tv/app/KEY" | |
YOUTUBE_BITRATE="9M" | |
TWITTER_BITRATE="9M" | |
TWITCH_BITRATE="7M" | |
LOCAL_RTMP="rtmp://0.0.0.0:1935" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2/KEY" | |
TWITTER_URL="rtmp://va.pscp.tv:80/x/KEY" | |
TWITCH_URL="rtmp://live.twitch.tv/app/KEY" | |
YOUTUBE_BITRATE="9M" | |
TWITTER_BITRATE="9M" | |
TWITCH_BITRATE="7M" | |
LOCAL_RTMP="rtmp://0.0.0.0:1935" | |
SOCKET_PATH="/tmp/live_stream.sock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
def rolling_hash(rect, prev_hash=0): | |
base = 256 | |
mod = 2 ** 64 # Large prime to reduce collisions | |
h = prev_hash | |
for val in rect: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# Define the parametric equations | |
def X(t): | |
return (4 / 9) * np.sin(2 * t) + (1 / 3) * (np.sin(t) ** 8) * np.cos(3 * t) + (1 / 8) * np.sin(2 * t) * ( | |
np.cos(247 * t) ** 4) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
unbind_gpu() { | |
echo "Unbinding NVIDIA driver..." | |
GPU_PCI=$(lspci | grep -i nvidia | cut -d ' ' -f 1) | |
for gpu in $GPU_PCI; do | |
echo -n "0000:$gpu" > /sys/bus/pci/drivers/nvidia/unbind | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import time | |
import random | |
import math | |
import pandas as pd | |
def is_sorted_permutation(perm): | |
for i in range(len(perm)): | |
for j in range(i, len(perm)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from pygame.locals import * | |
from OpenGL.GL import * | |
from OpenGL.GLU import * | |
import math | |
def draw_dotted_sphere(radius, lats, longs): | |
for i in range(lats): | |
lat0 = math.pi * (-0.5 + float(i) / lats) | |
z0 = radius * math.sin(lat0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global --unset credential.helper osxkeychain | |
git config --system --unset credential.helper osxkeychain | |
git config --global --unset credential.helper | |
git config --system --unset credential.helper | |
# disable gui prompt | |
git config --global core.askPass "" | |
git config --system core.askPass "" | |
# set up cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sum_series(n): | |
total_sum = 0 | |
for k in range(1, n + 1): | |
total_sum += 1 / (2 ** k) | |
return total_sum | |
n = 1000 # Number of terms to approximate the sum | |
result = sum_series(n) | |
print("Approximate sum of the series:", result) |
NewerOlder