Skip to content

Instantly share code, notes, and snippets.

View gatspy's full-sized avatar

CG.gatspy gatspy

View GitHub Profile
@gatspy
gatspy / curl.md
Created November 17, 2017 07:48 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@gatspy
gatspy / m3u8-concat.sh
Created November 28, 2017 18:02 — forked from maxwellito/m3u8-concat.sh
Concat / join .ts segment files into an mp4 file
#!/bin/sh
# This script must be executed in the repo where
# the *.ts files are.
# It will concatenate the segments into one temp
# file which ffmpeg will reencode the audio track.
# By default the ouptup filename is output.mp4
# but can be changed by providing the name as parameter.
#
# ffmpeg is required
@gatspy
gatspy / Record_HLS.sh
Created December 20, 2017 16:25 — forked from yalov/Record_HLS.sh
A small bash script to make ffmpeg recording HLS streams (m3u8).
#!/bin/bash
for i in {1..168} # week
do
echo "ITERATION $i"
seconds=3600 #hour
# Date format for the recording file name
@gatspy
gatspy / README.md
Created December 24, 2017 14:30 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@gatspy
gatspy / python2+3.md
Created January 4, 2018 02:26 — forked from splhack/python2+3.md
MacVim with Python 2.x and Python 3.x
  • Install python 2.7.11

command line

$ PYTHON_CONFIGURE_OPTS="--enable-shared" \
    LDSHARED="clang -bundle" \
    LDCXXSHARED="clang++ -bundle" \
    BLDSHARED="clang -bundle -lpython2.7" \
    pyenv install 2.7.11

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@gatspy
gatspy / es6-debugging-in-vscode.md
Created January 26, 2018 09:30 — forked from dchowitz/es6-debugging-in-vscode.md
Debugging ES6 in VS Code

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node

@gatspy
gatspy / idea
Created June 14, 2018 02:59 — forked from grocky/idea
Open IDEA applications based on project type from the command line!
#!/usr/bin/env bash
IDEA=''
PROJECT_DIR=''
function main() {
openIdea "$@"
}
function openIdea() {
@gatspy
gatspy / guidelines.md
Created September 21, 2018 21:01 — forked from glocore/guidelines.md
Coding Styleguides and Github Guidelines