Skip to content

Instantly share code, notes, and snippets.

View alectrocute's full-sized avatar
🐱

Alec Armbruster alectrocute

🐱
View GitHub Profile
@Maarten-Wijnants
Maarten-Wijnants / gist:ec4a3e9e65504e7e67a0873dca353871
Last active March 16, 2020 15:33
Ubuntu 14.04 Asterisk server installation
https://www.odoo.com/apps/modules/8.0/crm_voip/
# Install asterisk server on Ubuntu 14.04
# 1. Install dependencies
sudo apt-get update
sudo apt-get install wget
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install ncurses-dev
set found to 0
tell application "Google Chrome"
repeat with w in windows
set i to 1
repeat with t in tabs of w
if URL of t starts with "https://roamresearch.com/#/app/stian" then
activate
set active tab index of w to i
set index of w to 1
@acoomans
acoomans / vlcrecord.sh
Last active February 13, 2021 13:56
Record screen with VLC from command line (needs VLC nightly build)
/Applications/VLC-unstable.app/Contents/MacOS/VLC -I rc screen:// --noaudio --sout "#transcode{vcodec=h264,venc=x264, vb=800,acodec=none,scale=1.0}:std{access=file,mux=mp4,dst=my_first_transcoded_movie.mp4}"
@cobookman
cobookman / gist:c1a9856a4588496b021a
Last active August 17, 2021 12:39
HTML5 Audio (mp3) and Video (webm) live transcoding streams

The following two functions will stream just about any audio or video file to any browsers supporting mp3 and/or webm. Due to the unknown number of bytes, a custom html5 audio/video player will have to be written (my next step) to allow seeking.

For w/e reason node.js didn't want to spawn a child process with a unix pipe in it. This could be so that they can keep support for windows computers. As such I've created the following bash script:

#!/bin/bash
START_TIME=${2:-0}
VARIABLE_BIT_RATE=${3:-4}
ABSOLUTE_PATH=$1
@josephrocca
josephrocca / reddit-comment-stream.js
Last active March 26, 2023 15:47
Reddit Comment Stream (Node.js)
module.exports = function() {
let request = require("request-promise");
let stopFlag;
async function start() {
if(!this.oncomment) {
console.error("You must attach an oncomment handler (onerror handler is optional).");
return;
}
@marcelo-ribeiro
marcelo-ribeiro / javascript-remove-accents.js
Last active May 21, 2023 09:17 — forked from fabiofdsantos/angularJS_removeAccents.js
An Javascript function to remove accents and others characters from an input string.
// Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW
const accentsMap = new Map([
["A", "Á|À|Ã|Â|Ä"],
["a", "á|à|ã|â|ä"],
["E", "É|È|Ê|Ë"],
["e", "é|è|ê|ë"],
["I", "Í|Ì|Î|Ï"],
["i", "í|ì|î|ï"],
["O", "Ó|Ò|Ô|Õ|Ö"],
@jarlg
jarlg / sing.html
Created October 3, 2015 15:48
js example using webaudio to analyse mic input to control an oscillator
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type=text/javascript>
navigator.getUserMedia = navigator.getUserMedia
|| navigator.webkitGetUserMedia
|| navigator.mozGetUserMedia;
@also
also / wave.js
Created April 2, 2011 23:50
Generate WAVE file headers in JavaScript
// https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
function buildWaveHeader(opts) {
var numFrames = opts.numFrames;
var numChannels = opts.numChannels || 2;
var sampleRate = opts.sampleRate || 44100;
var bytesPerSample = opts.bytesPerSample || 2;
var blockAlign = numChannels * bytesPerSample;
var byteRate = sampleRate * blockAlign;
var dataSize = numFrames * blockAlign;
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@alectrocute
alectrocute / NGINXNodejsLinode.md
Last active February 24, 2024 08:16
Quick n' easy NGINX & Node.js VPS setup!

Quick n' easy NGINX & Node.js VPS setup!

N|SolidN|Solid N|Solid

Here's the quickest and easiest guide to setting up a little test enviorment. This guide likely applies to any VPS provider or VPS, not just Linode... it's just what I prefer to use. Assuming you know the basics of Linode's VPS system and SSH commands, let's get started!

Configure your Linode

  • Install your favorite flavor of Linux. I prefer Ubuntu.