Skip to content

Instantly share code, notes, and snippets.

View etale-cohomology's full-sized avatar

Diego Alonso etale-cohomology

View GitHub Profile
@jjpeleato
jjpeleato / InstallCurlWithHTTP2Support.sh
Last active January 6, 2024 13:39
Install Curl with HTTP2 support. (Script run on Ubuntu 16.04, 18.04 or 20.04)
#! /bin/bash
#
# Shell script for install Curl with HTTP2 support. Script run on Ubuntu 16.04, 18.04 or 20.04
#
# Notes:
# - Ubuntu environment is assumed
# - I did run shell script on Ubuntu 18.04
#
# Gratitude:
@whizkydee
whizkydee / ffmpeg.md
Created July 17, 2018 12:17 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@odashi
odashi / cudnn_convolution_forward.cu
Created January 8, 2018 15:40
Example usage of cuDNN convolution forward functions.
#include <iomanip>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cuda.h>
#include <cudnn.h>
#define CUDA_CALL(f) { \
cudaError_t err = (f); \

Stellar Portal

This is a draft for a decentralized web app for Stellar. It describes what the app should do. Some mock-ups showing these features would be welcomed.

Description

Stellar Portal is a decentralized web application to access the Stellar Network. Its goal is to provide people full control over their account and do most of transaction, without the need of a backend, by only using Horizon API.

@alecjacobson
alecjacobson / real-time-latex-in-browser.html
Last active September 26, 2020 03:49
Real-time LaTeX web application using MathJaX (e.g., for doing math during a Skype call)
<!DOCTYPE html>
<html>
<head>
<title>Real-time LaTeX in browser</title>
<!-- https://github.com/mathjax/MathJax/blob/master/test/sample-dynamic-2.html -->
<!-- Copyright (c) 2012-2015 The MathJax Consortium -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@matthewaveryusa
matthewaveryusa / grab_io_kbm.c
Created May 20, 2016 03:13
linux grab io from keyboard and mouse
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/input.h>
#include <time.h>
#include <stdint.h>
int main(int argc, char* argv[]){
sleep(1);
@jackmott
jackmott / SIMDStarterKit.h
Last active January 4, 2024 23:15
A header file to make SIMD intrinsics a bit easier to work with
// A header file to get you set going with Intel SIMD instrinsic programming.
// All necessary header files are inlucded for SSE2, SSE41, and AVX2
// Macros make the intrinsics easier to read and generic so you can compile to
// SSE2 or AVX2 with the flip of a #define
#define SSE2 //indicates we want SSE2
#define SSE41 //indicates we want SSE4.1 instructions (floor and blend is available)
#define AVX2 //indicates we want AVX2 instructions (double speed!)
@levlaz
levlaz / types_and_roles_demo.sql
Created March 28, 2016 19:11
Create Types and Roles If Not Exist in PostgreSQL
BEGIN;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'task_status') THEN
create type task_status AS ENUM ('todo', 'doing', 'blocked', 'done');
END IF;
END
$$;
CREATE TABLE IF NOT EXISTS
@Savjee
Savjee / gist:b4b3a21d143a30e7dc07
Created January 16, 2016 18:49
s3-webhosting-bucket-policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",