Skip to content

Instantly share code, notes, and snippets.

View aryehbeitz's full-sized avatar

Aryeh Beitz aryehbeitz

View GitHub Profile
@aryehbeitz
aryehbeitz / yeshai.js
Last active July 11, 2023 13:11
for yeshai
const arr = [23, 67, 54, 33, 1, 77];
var biggestNumber = 0;
for (var i = 0; i < arr.length; i++) {
if (arr[i] > biggestNumber) {
biggestNumber = arr[i];
}
}
@aryehbeitz
aryehbeitz / cloudSettings
Created February 15, 2020 21:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-15T21:37:34.796Z","extensionVersion":"v3.4.3"}
@aryehbeitz
aryehbeitz / tags.md
Created September 19, 2019 12:23
show tags
git for-each-ref --sort=taggerdate --format '%(tag)_,,,_%(taggerdate:raw)_,,,_%(taggername)_,,,_%(subject)' refs/tags | awk 'BEGIN { FS = "_,,,_"  } ; { t=strftime("%Y-%m-%d  %H:%M",$2); printf "%-20s %-18s %-15s %s\n", t, $1, $3, $4  }'
@aryehbeitz
aryehbeitz / detect-private-browsing.js
Created February 25, 2019 14:52 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@aryehbeitz
aryehbeitz / mysql.txt
Last active August 23, 2019 10:40
mysql stuff
mysql -u root -p
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT ON *.* TO 'username'@'localhost';
mysql -u username -p
CREATE DATABASE dbname;
USE dbname;
mysql -u username -p < example.sql
DROP DATABASE dbname;
@aryehbeitz
aryehbeitz / postgres.stuff
Last active July 10, 2019 08:05
postgres stuff
sudo su - postgres
psql
\l - list databases
\c db_name - connect to database
ALTER DATABASE db RENAME TO newdb; - rename database
\dt - list tables
\d+ tablename - list fields for table
\du - list users
CREATE DATABASE dbname;
DROP DATABASE [IF EXISTS] name;
@aryehbeitz
aryehbeitz / Git_Bisect.md
Last active October 26, 2022 08:34 — forked from stevenyap/Git_Bisect.md
Finding bugs in Git commits using git bisect

You have a git commit in your history that is causing a bug but you do not know which commit it is. Here's how to use git bisect to find the commit that causes the bug.

# in the git root, start the git bisect
git bisect start

# mark current commit as bad
git bisect bad
@aryehbeitz
aryehbeitz / GoPro RTMP streaming with FFmpeg
Created October 3, 2017 07:35 — forked from laurieainley/GoPro RTMP streaming with FFmpeg
Live streaming from a GoPro Hero3 camera to RTMP server using FFmpeg
Basic Requirements:
Computer with wired and wireless connection
FFmpeg installation: http://www.ffmpeg.org/
GoPro Hero 3+: http://gopro.com/
RTMP server e.g. FMS (http://www.adobe.com/products/adobe-media-server-family.html) or CDN ingest point
Overview:
GoPro Hero3 cameras produce HLS streams which are consumed by control apps and their removeable monitor.
@aryehbeitz
aryehbeitz / GoPro RTMP streaming with FFmpeg
Created October 3, 2017 07:35 — forked from laurieainley/GoPro RTMP streaming with FFmpeg
Live streaming from a GoPro Hero3 camera to RTMP server using FFmpeg
Basic Requirements:
Computer with wired and wireless connection
FFmpeg installation: http://www.ffmpeg.org/
GoPro Hero 3+: http://gopro.com/
RTMP server e.g. FMS (http://www.adobe.com/products/adobe-media-server-family.html) or CDN ingest point
Overview:
GoPro Hero3 cameras produce HLS streams which are consumed by control apps and their removeable monitor.
@aryehbeitz
aryehbeitz / gpControl.json
Created October 2, 2017 08:18 — forked from 3v1n0/gpControl.json
GoPro Hero4 Remote tools
{
"version":2.0,
"display_hints":[
{
"key":"GPCAMERA_GROUP_VIDEO",
"display_name":"Video Settings",
"settings":[
{
"setting_id":5,
"widget_type":"select",