Skip to content

Instantly share code, notes, and snippets.

@jonahlyn
jonahlyn / rtsp.md
Last active September 27, 2020 15:57
RTSP

Reading from an RTSP stream in Python

import numpy as np
import subprocess as sp

FFMPEG_BIN = '/usr/bin/ffmpeg'
RTSP_STREAM = "https://590804fbbbc47.streamlock.net:444/ruidosowebcorp2/ruidosowebcorp2.stream/playlist.m3u8"

What is the outcome of the two alerts below?

var foo = "Hello"; 
(function() { 
    var bar = " World"; 
    alert(foo + bar); 
})(); 
alert(foo + bar);
@jonahlyn
jonahlyn / file.md
Last active November 22, 2021 20:54
Run an ansible playbook on the localhost (without warnings)

inventory

[localhost]
127.0.0.1  ansible_connection=local

ansible.cfg

@jonahlyn
jonahlyn / bash-cheatsheet.sh
Last active December 2, 2019 18:28 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems #linux
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@jonahlyn
jonahlyn / gist:3cf4c4428a9abe641d2d
Created December 28, 2014 00:35
Read in activity data from Jawbone UP api in R (gist)
###########################################################################
# Read in activity data from Jawbone UP api in R
# 1. Setup an application at: https://jawbone.com/up/developer/
# 2. Set the OAuth redirect URLs: http://localhost:1410, http://localhost:1410/
# 3. Be sure to set your key and secret in R:
# Sys.setenv(JAWBONE_API_KEY = "Your Client Id",
# JAWBONE_CONSUMER_SECRET = "Your App Secret")
# 4. Install httr package: install.packages("httr")
###########################################################################
library("httr")
@jonahlyn
jonahlyn / SassMeister-input-HTML.html
Created December 9, 2014 16:05
Generated by SassMeister.com.
<ul class="programs"><li>
<h2 class="gamma">Doctor of Philosophy</h2>
<p> <img src="http://placehold.it/400x117"></p>
<p>Develop competencies to design, conduct, and report original theoretical and applied research in learning and human performance technologies.</p>
</li>
<li>
<h2 class="gamma">Master of Arts</h2>
<p> <img src="http://placehold.it/400x117"></p>
<p>Combine aspects of adult learning, learning sciences, organizational learning and development, and instructional technology.</p>
</li>
@jonahlyn
jonahlyn / gist:8f7c5c6e4d8c3c2627c8
Last active August 29, 2015 14:06
Set the locale in an R script (gist)
Sys.setlocale("LC_TIME", "English")
# Or if that doesn't work:
Sys.setlocale("LC_TIME", "C")
@jonahlyn
jonahlyn / gist:888882301a48fb527d30
Last active June 24, 2020 02:37
Python HTTP Server #python

Launch a Simple HTTP Server with Python

Change the directory to the location of the files you want to expose:

mkdir /tmp/nothing && cd /tmp/nothing

Default port 8000:

@jonahlyn
jonahlyn / gist:fd4961eeabead7d5f94d
Created August 6, 2014 22:30
SSH Tunnel Example
ssh jonahlyn@some.server.com -L 3306:localhost:3306
@jonahlyn
jonahlyn / mysql
Last active March 19, 2020 14:14
Connect to a mysql database in an R script #mysql #r
library("RMySQL")
conn <- dbConnect(MySQL(), user="jonahlyn", password="xxxxxxx", dbname="jonahlyndb", host="localhost")