Skip to content

Instantly share code, notes, and snippets.

View jamespantalones's full-sized avatar

James Singleton jamespantalones

View GitHub Profile
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active March 31, 2026 18:26
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@kozenumezawa
kozenumezawa / test.js
Created April 11, 2017 08:18
curved surface using three.js
const width2 = 100, height2 = 100, width_segments =1, height_segments = 100;
this.plane = new THREE.PlaneGeometry(width2, height2, width_segments, height_segments);
for(let i=0; i<this.plane.vertices.length/2; i++) {
this.plane.vertices[2*i].z = Math.pow(2, i/20);
this.plane.vertices[2*i+1].z = Math.pow(2, i/20);
}
this.mesh2 = new THREE.Mesh(this.plane, new THREE.MeshBasicMaterial({color: 0xffffff}));
this.mesh2.doubleSided = true;
this.mesh2.rotation.y = Math.PI/2-0.5;
@jamespantalones
jamespantalones / GLSL-Noise.md
Created December 30, 2016 20:41 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@juhaelee
juhaelee / react-typescript.md
Last active October 19, 2025 22:00
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@bittu
bittu / img-to-base64_webworkers.js
Last active August 4, 2019 17:14
Javascript Web Workers to process images to base64 data url without canvas using ES2015 Promises
let imgs = ['image1.jpg', 'image2.jpg']
let convertedImages = [];
let worker = new Worker('worker.js');
worker.addEventListener('message', function(event) {
convertedImages = event.data;
})
@revolunet
revolunet / web-audio-fetch-stream.js
Last active June 30, 2024 09:21
Web Audio streaming with fetch API
//
// loads remote file using fetch() streams and "pipe" it to webaudio API
// remote file must have CORS enabled if on another domain
//
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api
//
function play(url) {
var context = new (window.AudioContext || window.webkitAudioContext)();
@tophtucker
tophtucker / index.html
Last active June 13, 2016 20:44
Slander II
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" type="text/css" href="main.css"/>
<body>
@jongacnik
jongacnik / addEmailLambda.js
Created January 29, 2016 23:53
addEmailLambda.js
var doc = require('dynamodb-doc')
var dynamo = new doc.DynamoDB()
exports.handler = function (event, context) {
var params = {
"TableName": "SignupTable",
"Item": {
"type": "email",
"email": event.email,
@d-schmidt
d-schmidt / redirectExample.go
Last active March 12, 2024 08:04
How to redirect HTTP to HTTPS with a golang webserver.
package main
import (
"net/http"
"log"
)
func redirect(w http.ResponseWriter, req *http.Request) {
// remove/add not default ports from req.Host
target := "https://" + req.Host + req.URL.Path
if len(req.URL.RawQuery) > 0 {
@kylemcdonald
kylemcdonald / FAT-lost.md
Last active August 29, 2015 14:26
The other reasons F.A.T. Lab died.

Today F.A.T. Lab shut its doors with this lovely note from Magnus Eriksson and Evan Roth.

But the "we lost to them" narrative is only one perspective. As a "virtual research fellow" since 2011, I had the opportunity to both look up to F.A.T. as an outsider for its first half, and get the inside scoop for the second half. But my first project appears on page 20 of the blog's 200+ pages. With that in mind, here are some other stories about why F.A.T. "lost":

  1. F.A.T. lost its rowdy juvenile edge when almost everyone got married, had kids, got (mostly) real jobs. The biggest producers from early F.A.T. effectively "retired" from producing F.A.T.-style work.
  2. There was not enough new energy to replace these retired members. To fix this, sometimes a member would propose adding someone. Inevitably, someone else would suggest they "weren't F.A.T. enough", or just thinking about how many inactive members we had, and how much of a boys club it was, would get us down and discussion woul