Skip to content

Instantly share code, notes, and snippets.

View gatspy's full-sized avatar

CG.gatspy gatspy

View GitHub Profile
@gatspy
gatspy / Nginx-minio-static.md
Created March 13, 2019 16:39 — forked from harshavardhana/nginx-minio-static.md
How to configure nginx+minio static website?

Ubuntu 16.04

  1. Install nginx
  2. Install minio
  3. Install mc client
  4. Create a bucket:
$ mc mb myminio/static
Bucket created successfully ‘myminio/static’.
@gatspy
gatspy / proxy_for_terminal.md
Created January 30, 2019 15:18 — forked from fearblackcat/proxy_for_terminal.md
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@gatspy
gatspy / GatewayApplication.java
Created January 12, 2019 10:47 — forked from WeirdBob/GatewayApplication.java
Spring cloud gateway response body modification
package examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableAutoConfiguration
public class GatewayApplication {
@gatspy
gatspy / README.md
Created November 20, 2018 18:41 — forked from smrchy/README.md
Sort a SQL query with id and parentid so that the rows have the correct order of the tree.

_queryTreeSort

Note: Please check this blog post for more details on these functions.

Sort a SQL query with id and parentid so that the rows have the correct order of the tree.

Parameters:

  • q (Array): A query result (see example below)
@gatspy
gatspy / Greeting.java
Created October 16, 2018 13:51
Oauth2RestTemplate example - this goes with the spring boot rest oauth example project (https://github.com/royclarkson/spring-rest-service-oauth) but the Greeting class needs to have setters and a default constructor.
package hello;
public class Greeting {
private long id;
private String content;
public Greeting(){}
public Greeting(long id, String content) {
@gatspy
gatspy / guidelines.md
Created September 21, 2018 21:01 — forked from glocore/guidelines.md
Coding Styleguides and Github Guidelines
@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 / 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

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track