Skip to content

Instantly share code, notes, and snippets.

View cchudant's full-sized avatar
🥳
happy

cchudant

🥳
happy
  • Paris, France
  • 22:09 (UTC +02:00)
View GitHub Profile
@cchudant
cchudant / cub3d.h
Last active January 7, 2020 10:27
Cub3d / MiniRT save first frame to .BMP file
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cube3d.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchudant <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/19 15:14:01 by cchudant #+# #+# */
/* Updated: 2019/11/21 15:09:43 by cchudant ### ########.fr */
/* */
#!/bin/bash
URL=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
INSTALL_SCRIPT=/tmp/Miniconda3-latest-MacOSX-x86_64.sh
INSTALL_DIR=/goinfre/anaconda3
function remove_python {
rm -rf $INSTALL_DIR
sed -i '' "/^export PATH='\/goinfre\/anaconda3\/bin:\$PATH'$/d" ~/.zshrc
echo "Python has been removed."

Usage

Use gcc {your files} main.c -D MINE to compile main.c with your program

Use gcc main.c to compile main.c with libc's implementation

Tests are easy to add, and the TEST macro will display what printf (or ft_printf) returns

Use -D BONUS to test the bonuses

(() => {
const insertScript = src => {
const elem = document.createElement('script')
elem.src = src
document.head.append(elem)
}
const proxy = (original, proxyFn) => function (...args) {
try {
@cchudant
cchudant / nyaa_comments.js
Created August 11, 2019 22:14
Scrap nyaa comments and expose them as an RSS feed
const httpFetch = require('node-fetch')
const { JSDOM } = require('jsdom')
const express = require('express')
const morgan = require('morgan')
const { Feed } = require('feed')
const xmlEscape = require('xml-escape')
const wait = t => new Promise(r => setTimeout(r, t))
const {
const httpFetch = require('node-fetch')
const { JSDOM } = require('jsdom')
const express = require('express')
const morgan = require('morgan')
const NodeCache = require('node-cache')
const { Feed } = require('feed')
const {
PORT = 8080
} = process.env
@cchudant
cchudant / !ftnl_graph.md
Last active October 4, 2018 17:02
Graph des serveurs du bot FTNL

Graph des serveurs du bot FTNL

Lancer les script dans cet ordre.

Résultats

@cchudant
cchudant / build_sdl2_for_the_web.sh
Last active October 1, 2018 00:39
Build sdl2 for the web
#!/bin/sh
emcc *.c\
-O2\
-s WASM=1\
-s USE_SDL=2\
-s USE_SDL_IMAGE=2\
-s USE_SDL_NET=2\
-s ALLOW_MEMORY_GROWTH=1\
--use-preload-plugins\
--preload-file resource\
@cchudant
cchudant / serve.py
Created September 30, 2018 09:35
Serve a wasm application
import SimpleHTTPServer
import SocketServer
PORT = 8000
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
pass
Handler.extensions_map['.wasm'] = 'application/wasm'
const ffmpeg = require('fluent-ffmpeg')
const fetch = require('node-fetch')
const FormData = require('form-data')
const { PassThrough } = require('stream')
const apiUrl = 'https://bayfiles.com/api/upload'
const idreg = /^(https?:\/\/[^\/]+)\/([0-9A-Za-z_-]+)/
const namereg = /([^\/]+)$/