Skip to content

Instantly share code, notes, and snippets.

@imjp94
imjp94 / build.gd
Last active January 10, 2023 18:21
Build script to help exporting Godot project.
tool
extends SceneTree
const PLATFORM_ANDROID = "Android"
const PLATFORM_HTML5 = "HTML5"
const PLATFORM_IOS = "iOS"
const PLATFORM_LINUX = "Linux/X11"
const PLATFORM_MAC = "Mac OSX"
const PLATFORM_UWP = "UWP"
const PLATFORM_WINDOWS = "Windows Desktop"
@LingDong-
LingDong- / ln.c
Last active May 21, 2024 10:37
simple, fast, accurate natural log approximation without <math.h>
// ln.c
//
// simple, fast, accurate natural log approximation
// when without <math.h>
// featuring * floating point bit level hacking,
// * x=m*2^p => ln(x)=ln(m)+ln(2)p,
// * Remez algorithm
// by Lingdong Huang, 2020. Public domain.
@NickNaso
NickNaso / cpp.yml
Created June 3, 2020 23:55
Example of Github action for C++ rpoject
# This is a basic workflow to help you get started with Actions
# workflow - цепочка действий
# Имя процесса Билдится на всех типах 📦 🐍
name: CMake Build Matrix
# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h> /* of course */
#include <X11/Xutil.h> /* duuuh */
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h> /* obviously */
@Apfelin
Apfelin / STTBot.py
Last active May 31, 2024 18:30
Discord speech-to-text bot, made with discord.py by Rapptz and voice additions by imayhaveborkedit. Uses wit.ai for speech recognition
import discord
import asyncio
import speech_recognition as sr
from threading import Thread
# bot token and wit.ai api key
TOKEN = ""
WIT_AI_KEY = ""
# we need a sink for the listen function, so we just define our own
@Redchards
Redchards / Platform.hxx
Created November 28, 2015 08:23
Simple definition file to ease multi-platform compilation in C++
#ifndef PLATFORM
#define PLATFORM
#define GCC_COMPILER 1
#define MVSC_COMPILER 2
#define ICC_COMPILER 3
#define BORLAND_COMPILER 4
#define LINUX 1
#define WINDOWS 2
@mazurio
mazurio / gist:5092dc53bd4a4db956a1
Created April 19, 2015 17:52
Basic SDL2 Template
#include <iostream>
#include <SDL.h>
using namespace std;
int main() {
if(SDL_Init(SDL_INIT_VIDEO) != 0) {
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active June 19, 2024 15:44
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@richard-to
richard-to / x11_screen_grab.cpp
Created April 7, 2014 10:30
X11 Example code for grabbing screenshots of window and sending key events
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <X11/Xlib.h>