Skip to content

Instantly share code, notes, and snippets.

View ppalone's full-sized avatar
🎯
Focusing

Pranjal Alone ppalone

🎯
Focusing
View GitHub Profile
@amk221
amk221 / placeholder.css
Last active May 3, 2024 13:11
Prosemirror placeholder plugin approach
.ProseMirror[data-placeholder]::before {
color: global.$placeholder-colour;
position: absolute;
content: attr(data-placeholder);
pointer-events: none;
}
@daz
daz / generate-silence.sh
Created October 23, 2017 07:25
Generate a silent AAC audio with ffmpeg
ffmpeg -f lavfi -i anullsrc=r=11025:cl=mono -t <number of seconds> -acodec aac out.m4a
@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created September 16, 2017 12:19 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@mattli001
mattli001 / ffmpeg_test.go
Created May 19, 2017 01:56
golang test ffmpeg example
package ffmpeg
import (
"bytes"
"context"
"io"
"os"
"os/exec"
"strings"
"testing"
@LunaSquee
LunaSquee / queue.js
Last active February 16, 2023 01:52
Liquidsoap radio + youtube-dl queueing (Node.js as helper)
// $ node queue <file name or youtube URL>
const net = require('net')
let client = net.connect(1234, 'localhost')
client.on('connect', function () {
if (process.argv[2]) {
console.log('Queueing ' + process.argv[2])
client.write('queue.push smart:' + process.argv[2] + '\r\n')
}
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 26, 2024 01:50
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@sebble
sebble / stars.sh
Last active February 17, 2024 16:49
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
@inotnako
inotnako / server.go
Last active August 29, 2023 11:38
get meta from html page
package main
import (
"encoding/json"
"net/http"
"net/url"
"golang.org/x/net/html"
"io"
)
@gophertron
gophertron / weboauth.go
Last active November 25, 2023 06:36
github oauth gorilla
package main
import (
"fmt"
"log"
"net/http"
"github.com/codegangsta/negroni"
gh "github.com/google/go-github/github"
"github.com/gorilla/mux"
@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection