Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// #cgo pkg-config: pangocairo | |
// #include <pango/pangocairo.h> | |
// void draw(const char *font, const char *text, const char *output) { | |
// int width, height; | |
// PangoFontDescription *font_description = pango_font_description_from_string(font); | |
// { | |
// cairo_surface_t *cairo_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0); | |
// cairo_t *cr = cairo_create(cairo_surface); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgbase = llvm-toolchain-nightly-bin | |
pkgdesc = NOT READY YET. Precompiled binaries of llvm-toolchain (clang+lld+lldb+...) nightly builds. Status: Can't fetch llvm version. | |
pkgver = 12 | |
pkgrel = 1 | |
url = https://llvm.org/ | |
arch = x86_64 | |
license = custom:Apache 2.0 with LLVM Exception | |
makedepends = patchelf | |
makedepends = wget | |
depends = libedit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://maktabkhooneh.org/course/%D9%85%D8%A8%D8%A7%D9%86%DB%8C-%D8%A7%D9%82%D8%AA%D8%B5%D8%A7%D8%AF-mk170/ | |
[...document.querySelectorAll('a.chapter__unit')] | |
.map(x => () => fetch(x.href) | |
.then(x => x.text()) | |
.then(x => new DOMParser().parseFromString(x, 'text/html').querySelector('meta[property="og:video"]').content) | |
.then(y => console.log(y, x.children[1].innerText.trim().replace(/\s/g, '_') + '.mp4')) | |
) | |
.reduce((promise, next) => promise.then(next), Promise.resolve()) | |
.then(() => console.log('Finished!')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
import bs4 | |
import requests | |
def extract_files(site_name): | |
dirs = deque('/') | |
result = [] | |
while len(dirs): | |
path = dirs.pop() | |
page = bs4.BeautifulSoup(requests.get(site_name + path).text, 'html.parser') | |
for link in page.find_all('a'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// modified version of nesemu1.cc, STL is removed | |
// clang -fno-threadsafe-statics -lm -fno-exceptions nesemu1.cc `pkg-config sdl --libs --cflags` -Wall -W -pedantic -Ofast -std=c++0x -g -Og && ./a.out Rockman.nes | |
#include <stdint.h> | |
#include <signal.h> | |
#include <assert.h> | |
#include <math.h> | |
#include <SDL.h> | |
/* NESEMU1 : EMULATOR FOR THE NINTENDO ENTERTAINMENT SYSTEM (R) ARCHITECTURE */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc nvpath.c -o nvpath -lGL -lglfw && primusrun ./nvpath | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <GLFW/glfw3.h> | |
#ifndef __APPLE__ | |
PFNGLPATHCOMMANDSNVPROC glPathCommandsNV = NULL; | |
PFNGLCOVERSTROKEPATHNVPROC glCoverStrokePathNV = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const portAudio = require('naudiodon'); | |
var http = require('http'); | |
var clients = []; | |
http.createServer((req, res) => { | |
if (req.url === '/data') clients.push(res); | |
else res.end(`<script> | |
var context = new AudioContext(); | |
fetch('/data').then(response => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<style> | |
@font-face { | |
font-family: iransans; | |
src: url("data:font/ttf;base64,AAEAAAAPAIAAAwBwRFNJRwAAAAEAANH0AAAACEdERUYVzhQ8AADR/AAAAJBHUE9T2pZ3rgAA0owAABV4R1NVQvHy3JkAAOgEAAAFJk9TLzKfIOoCAAABeAAAAGBjbWFw6J3s7AAACTgAAAdIZ2FzcAAIABYAANHoAAAADGdseWYg6RLXAAAUNAAApxxoZWFkE8RzMgAAAPwAAAA2aGhlYRFuB5UAAAE0AAAAJGhtdHgLgBkBAAAB2AAAB2Bsb2NhC+niBgAAEIAAAAOybWF4cAHpAekAAAFYAAAAIG5hbWVc7P65AAC7UAAABgNwb3N0jrcN1gAAwVQAABCTAAEAAAABAAC5josHXw889QAJCPwAAAAA1kPDygAAAADWWGNo+677WAxdCq4AAAAJAAIAAAAAAAAAAQAACWD7UAAADLD7rv28DF0AAQAAAAAAAAAAAAAAAAAAAdgAAQAAAdgA+AAGAO8ABQABAAAAAAAAAAAAAAAAAAUAAQADBO0BkAAFAAAFmgUzAAABHwWaBTMAAAPRAGYDXAAAAgsFBgMIBAICBIAAIAMAAAAAAAAACAAAAABHT09HAEAAAP7/CPz7tAAACWAEsAAAAEEACAAABL8GYwAAACAABQTNAGYAAAAAAloAAAK4AAAD+wBwAhgAkwJwAMAGbwA4BlP/owal/5wGpgB0BGcAbgOaAA8D4gANCoQASAZ6/58HYf+oC0kAbQtkAJQHgP+dB6r/mws0ACgHGAAeBij/nAYv/5UHSwASBfwAbwRy/6QEkf+bBU0AaAR7/50ErP+aB+gAEggcACUFywBhAjn/nAKi/5kF/AA5BNUASQSN/5gEvv+ZBPsANwPeAF4F8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/openstreetmap/openstreetmap-website/blob/e72acaca9b988d41298415d51a10533d3a27e958/lib/osm.rb#L452 | |
function bounds(lat, lon, radius) { | |
lat = lat * Math.PI / 180; | |
lon = lon * Math.PI / 180; | |
var latradius = 2 * Math.asin(Math.sqrt(Math.sin(radius / 6372.795 / 2)**2)); | |
try { | |
var lonradius = 2 * Math.asin(Math.sqrt(Math.sin(radius / 6372.795 / 2)**2 / Math.cos(lat)**2)) | |
} catch (e) { | |
var lonradius = PI; |